Commit fb14e9c3 authored by Jared Sexton's avatar Jared Sexton

Compiling

parent 35885381
/* ============================================================================
Main Function
g++ -std=c++11 MAIN.cpp Questions.cpp Teacher.cpp -o MAIN.cpp.o && ./MAIN.cpp.o
Student.cpp (add in when it exists)
g++ -std=c++11 MAIN.cpp Questions.cpp Teacher.cpp Student.cpp -o MAIN.cpp.o && ./MAIN.cpp.o
============================================================================
*/
......@@ -40,7 +39,12 @@ int main() {
Student currentStudent;
currentStudent = teacher.getStudent(currentUserIndex);
// Current user (Student object) is currentStudent
do {
currentStudent.displayMenu();
if (!currentStudent.getMenuActive()) {
break;
}
} while (true);
// save any changes back into teacher vector
......
......@@ -101,28 +101,25 @@ void Student::practice(){
//Testing Stage: exit testing mode and go back to menu.
void Student::testingStage(){
int count =0;
int questions=10;
int question=10;
int levelIn = getLevel();
char choice;
bool testOut, finish;
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? */
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--;
}else{ //if right it increments the count and decrements the question var
count++;
question--;
}
}
if(count>=7){
cout << "Congratulations! you have passed." << endl;
setLevel(++levelIn);
}else{
cout << "Tough luck. try harder next time.";
}
}
......
......@@ -13,6 +13,6 @@ grifno 1
levina 4
Andrew 500
Sam 2
Jared 1
Jared 4
bindan 43
END_OF_FILE
\ No newline at end of file
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