|
From: Noorez K. <coo...@ho...> - 2004-06-21 05:10:55
|
The marked loop keeps going on forever. Even if the condition in false
int main()
{
cout << "Welcome to the quiz maker.\n";
cout << "With this program you can make a Multiple Choice/True or False
quiz.\n";
cout << "We need the name of the quiz file: ";
char* quizName = new char;
cin.getline(quizName,123);
strcat(quizName,".qz");
cout << "If filename exists it will be overwritten\n";
cout << "Continue [Y\\N]";
char goOn;
do//this loop
{
cin >> goOn;
cin.sync();
if(goOn == 'n' || goOn == 'N')
return 0;
}while(goOn != 'n' || goOn != 'N' || goOn != 'y' || goOn != 'Y');//keeps
running even if goOn == 'y' || goOn == 'Y'
cout << endl << "\nLets start making questions!\n";
system("pause");
system("cls");
Quiz question;
char contin;
do
{
question = question.createQuestion();
question.writeQuestion(question,Quiz::type,quizName);
Quiz::questionNumb = Quiz::questionNumb+1;
cout << "\nDo you want to add another question [Y\\N] ";
do
{
cin >> contin;
}while(!(contin == 'y' || contin == 'Y' || contin == 'n' || contin
== 'N'));
}while(contin == 'y' || contin == 'Y');
}
_________________________________________________________________
Free yourself from those irritating pop-up ads with MSn Premium. Get 2months
FREE*
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
|