Commit 0a0355c7 authored by Eddy Marinez's avatar Eddy Marinez

this

parent dc73ebb6
......@@ -72,18 +72,18 @@ void Student::practice(){
char choice;
bool gotitGood, testing;
do{
gotitGood=questionAsk.mainQuestionAsk(getLevel());
gotitGood=questionAsk.mainQuestionAsk(getLevel()); //set equal to a bool expression to check if true, also helps keep track
if(gotitGood==true){
count++;
}if(count>=3){
do{
cout << "Would you like to test out? (Y)es/(N)o ";
cin >> choice;
if(choice == 'Y'){
if(choice == 'Y'){ //testing stage
testingStage();
testing = true;
break;
}else if(choice == 'N'){
}else if(choice == 'N'){ //reset values for count
count=0;
break;
}else{
......@@ -99,21 +99,29 @@ void Student::practice(){
//Testing Stage: congratulate if they get enough right. increment dificulty level.
//Testing Stage: exit testing mode and go back to menu.
void Student::testingStage(){
int count =0;
int count =0;
int questions=10;
int levelIn = getLevel();
char choice;
bool testOut, finish;
while(true){
testOut=questionAsk.mainQuestionAsk(getLevel());
if(testOut==true){
count++;
}if(count>=5){
cout << "Congratulations! you have passed." << endl;
setLevel(++levelIn);
break;
} /* Note (from Jared): Can we add something so that this will only ask a certain number of questions (say, 10?)
and if they don't get enough f them right by then, it will tell them they need to practice more? */
}
while(question > 1){
testOut=questionAsk.mainQuestionAsk(getLevel()); //set equal to a bool expression to check if true, also helps keep track
if(testOut==false){ //decrements question var if wrong
question--;
}if(testOut==true){ //if right it increments the count and decrements the question var
count++;
question--;
}if(count>=(question/2)){
cout << "Congratulations! you have passed." << endl;
setLevel(++levelIn);
break;
}else{
cout << "Tough luck. try harder next time.";
/* some code to loop it back to the practice section? */
}
/* Note (from Jared): Can we add something so that this will only ask a certain number of questions (say, 10?)
and if they don't get enough f them right by then, it will tell them they need to practice more? */
}
}
......@@ -131,4 +139,4 @@ void Student::setLevel(int levelIn) {
void Student::setUserName(string userNameIn) {
userName = userNameIn;
}
\ No newline at end of file
}
......@@ -27,6 +27,7 @@ class Student {
// Accessors
int getLevel();
string getUserName();
const bool getMenuActive();
//Student functions.
void displayMenu(); //Display menu; show the current level, option to practice or log out.
......
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