Friday, July 31, 2009

C++ Counting Problem?

I'm attempting to count how many correct, second-try corrects, and incorrects [Incorrect after second try is wrong].





Here's my code so far:


[I have the subroutines defined before this and everything, so, that's definately not the problem. I'm just going to put down my subroutine I'm using at the moment.


Addition()


{





randomize();


int A, B, C, D, setnum, correct2, incorrect, insane;


int number, correct, count2;


textcolor(RED+BLUE);


clrscr();


gotoxy(15, 12);


int i;


cout%26lt;%26lt;"Why, hello there! How many questions do you want to solve?\n\n";


cin%26gt;%26gt;setnum;


clrscr();


gotoxy(15,12);


cout%26lt;%26lt;"Okay, then! You have "%26lt;%26lt;setnum%26lt;%26lt;" to answer! :]";


getch();


textcolor(RED+BLUE);


clrscr();


gotoxy(15, 12);

C++ Counting Problem?
You aren't initializing your correct, correct2, and incorrect counters. Set them to zero before you use them





Also, in C++ you don't need to use printf( ).


No comments:

Post a Comment