I was looking for a solution in c# programming. Thank you though.
Type: Posts; User: lancehumiston
I was looking for a solution in c# programming. Thank you though.
I am working on an assignment to create a Complex number calculator. In this assignment I am to ask the user for input to the calculator. We are given a sample run output that looks like this.
...
can't believe i forgot to put that. thank you
Header file for base class
#ifndef EMPLOYEE_H
#define EMPLOYEE_H
#include <string>
using namespace std;
class Employee
{
public:
//--- Definition of push()
void Stack::push(const StackElement & value)
{
Stack::NodePointer ptr;
Stack::NodePointer prev;
if(value%2==0)
first = new Stack::Node(value, first);...
okay thanks that makes sense but even with the new Stack being set to prev I'm still not receiving any odd integers in the output. Whether or not I put them at the begining, the end, or somewhere in...
ptr->next = new Stack::Node(value, NULL);
like this?
my program crashes when it tries to execute this line
I realized i didn't have
ptr = ptr->next;
in my for loop but now I am not getting any odd data back when I call display?
Here is the function for display as well
//---...
//--- Definition of push()
void Stack::push(const StackElement & value)
{
Stack::NodePointer ptr;
if(value%2==0)
first = new Stack::Node(value, first);
else{
ptr =...
I'm writing my code in codeblocks 10.05. How would I change to a Console program?
I'm trying to compile my first program that uses a class file and am getting a "undefined reference to WinMain@16" error. Does anyone know how to fix this? Thank you!
I am trying to allocate memory for a 2 dimensional array of size declared by the user but am not quite sure how to do this. I read several forums about it to generate the code I have so far but am...
#include <iostream>
#include <vector>
using namespace std;
void MagicSquare ( double matrix, int n );
void DisplaySquare ( int matrix, int n );
int main(void)
{
int order;
sorry but now I am recieving a conflicting declaration error for that line?
I added that after reading 'order' and added header #include <vector> but now it is saying template argument 1 and template argument 2 are invalid errors for that line?
I am trying to write a program that creates a magic square of two dimensions. The size of the array needs to be decided by the user so it can't be predefined. I've come across a few different ways to...
#include<stdio.h>
main()
{
int x;
int r;
char response;
srand( time(NULL) );
do{
printf("I have a number between 1 and 10.\n");
yeah i am unsure how to recieve their response, is it possible with a scanf? if so, how do i store their response? scanf("%d?
thank you i was getting an undefined symbol message but i put the...
how should i define NULL in srand( time(NULL) );? i thought unsigned was the correct way?
Also i just went through the tutorial on loops and it didn't tell me anything about changing a user's...
i know where the loop needs to be my question was more along the lines of how do i create the loop while (?) and how do i use the user's respons (y or n) to return a true or false for the loop?
main()
{
int x;
int r;
unsigned NULL;
printf("I have a number between 1 and 10.\n");
printf("Can you guess my number?\n");
printf("Please type your first guess.\n");
scanf("%d", &x);
srand(...
#include <stdio.h>
#include <math.h>
int isprime(int n);
int main(void)
{
int i;
int count=1;
printf( "The prime numbers from 1 to 1000 are \n" );