diff --git a/Student.cpp b/Student.cpp index 5bb270051f8b9a294b2958357359d75760805e8c..998fa7429e2c3a53b0b48536a8e9d29fda6e8c0e 100644 --- a/Student.cpp +++ b/Student.cpp @@ -48,6 +48,7 @@ void Student::displayMenu(){ break; case 2: // Log Out cout << "Goodbye." << endl; + studentMenuActive =0; break; /* Can you have something here that will cause the program to exit the menu when they choose logout? 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). @@ -140,3 +141,6 @@ void Student::setLevel(int levelIn) { void Student::setUserName(string userNameIn) { userName = userNameIn; } +const bool Student::getMenuActive() { + return studentMenuActive; +} \ No newline at end of file diff --git a/Student.h b/Student.h index 4dd17be95930a29f5a6ff069310f24f256bc5cd2..3c0257aef405669d31b703ec6c26f0742e062dbe 100644 --- a/Student.h +++ b/Student.h @@ -46,6 +46,7 @@ class Student { void setUserName(string userNameIn); private: + bool studentMenuActive = 1; string userName; int level = 1; Questions questionAsk;