Commit 1dd6344f authored by Jared Sexton's avatar Jared Sexton

Fixed a problem with Students leveling up past level 109

parent ce5ccfbe
......@@ -25,7 +25,7 @@ class Questions {
bool wordQuestion(int level);
// Accessor
int getMaxLevel() { return maxLevel; }
static int getMaxLevel() { return maxLevel; }
private:
static const int maxLevel = 10;
......
......@@ -122,6 +122,9 @@ void Student::testingStage(){
if(count>=7){
cout << "Congratulations! you have passed." << endl;
setLevel(++levelIn);
if(getLevel() > questionAsk.getMaxLevel()) {
setLevel(questionAsk.getMaxLevel());
}
}else{
cout << "Tough luck. try harder next time.";
}
......
......@@ -13,6 +13,6 @@ grifno 1
levina 4
Andrew 10
Sam 2
Jared 4
Jared 6
bindan 10
END_OF_FILE
\ No newline at end of file
Jason 10
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