|
From: Alfred P. R. <al...@ya...> - 2005-04-23 02:20:59
|
Apologies, the variable onepass became onfiltered during spell checking in my copy, so I'm expecting that it did in yours too!
"Alfred P. Reaud" <al...@ya...> wrote:<snip>
bool onepass = false;
system("CLS");
cout << "Student Pack \t\t\t\t\t\t\t\t v1.0" << endl << endl;
cout << "Please Make A Selection " << endl;
cout << "------------------------" << endl;
cout << "(M)oney Counter" << endl << endl;
cout << "(T)emperature Converter" << endl << endl;
cout << "(C)alculator" << endl << endl;
cout << "C(r)edits" << endl << endl;
cout << "(B)ug Reporting" << endl << endl;
cout << "(E)xit" << endl << endl;
do {
cin >> menuSelection;
// It may be better to use getche if menuSelection is an int.
// menuSelection = getche();
if ( (menuSelection == 'm') || (menuSelection == 't') || (menuSelection == 'c') || (menuSelection == 'r') || (menuSelection == 'b') || (menuSelection == 'e') ) {
menuSelection = (menuSelection - 32);
break;
}
else {
// To only do one pass here add the boolean flag as follows
if (!onepass) {
cout << "Please make a proper slection. " << endl;
onepass = true;
}
}
} while ( true );
<snip>
Alfred P. Reaud
|