Commit d9c7ddc4 authored by Jared Sexton's avatar Jared Sexton

maxLevel

parent fb14e9c3
...@@ -145,6 +145,7 @@ bool Questions::addSubQuestion(int level) { ...@@ -145,6 +145,7 @@ bool Questions::addSubQuestion(int level) {
return false; return false;
} }
bool Questions::wordQuestion(int level) { bool Questions::wordQuestion(int level) {
cout << "Question type not configured."; cout << "Question type not configured.";
return false; return false;
......
...@@ -23,6 +23,12 @@ class Questions { ...@@ -23,6 +23,12 @@ class Questions {
// Asks a question, returns true if the kid was right, false if they were wrong. // Asks a question, returns true if the kid was right, false if they were wrong.
bool wordQuestion(int level); bool wordQuestion(int level);
// Accessor
int getMaxLevel() { return maxLevel; }
private:
int maxLevel = 10;
}; };
#endif //QUESTIONS_H #endif //QUESTIONS_H
\ No newline at end of file
...@@ -49,10 +49,7 @@ void Student::displayMenu(){ ...@@ -49,10 +49,7 @@ void Student::displayMenu(){
case 2: // Log Out case 2: // Log Out
cout << "Goodbye." << endl; cout << "Goodbye." << endl;
studentMenuActive =0; studentMenuActive =0;
break; /* Can you have something here that will cause the program to exit the menu when they choose logout? break;
This can be done with a boolean return type for this function (returns true until they choose to logout, then it returns false)
Or with a separate function like Andrew did in Teacher (you can check his code for a template).
The idea is that as much of the process of each menu is contained within the menu function, (ecapsulation). */
default: default:
cout << "Invalid choice.\n"; cout << "Invalid choice.\n";
break; break;
...@@ -80,16 +77,24 @@ void Student::practice(){ ...@@ -80,16 +77,24 @@ void Student::practice(){
do{ do{
cout << "Would you like to test out? (Y)es/(N)o "; cout << "Would you like to test out? (Y)es/(N)o ";
cin >> choice; cin >> choice;
if(choice == 'Y'){ //testing stage if(cin) {
testingStage(); if(choice == 'Y'){ //testing stage
testing = true; testingStage();
break; testing = true;
}else if(choice == 'N'){ //reset values for count break;
count=0; }else if(choice == 'N'){ //reset values for count
break; count=0;
}else{ break;
cout << "Invalid input." <<endl; }else{
continue; cin.clear();
cin.ignore(100,'\n');
cerr << "Invalid choice." <<endl;
continue;
}
} else {
cin.clear();
cin.ignore(100,'\n');
cerr << "Invalid choice.\n";
} }
}while(true); }while(true);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment