From cba7cbc5c863c7b9af384ca12c9f2ff5b5e55faf Mon Sep 17 00:00:00 2001 From: Jared Sexton Date: Mon, 5 Mar 2018 02:50:17 +0000 Subject: [PATCH] Updating Question Class --- Question_driver.cpp | 2 +- Questions.cpp | 8 ++------ Questions.h | 7 ++++--- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Question_driver.cpp b/Question_driver.cpp index 08154cb..9abf4b6 100644 --- a/Question_driver.cpp +++ b/Question_driver.cpp @@ -12,7 +12,7 @@ int main() { Questions questionList; for(int i = 1; i <= 10; i++ ) { - questionList.determineQuestion(i); + questionList. mainQuestionAsk(i); cout << "Level Up!\n"; } diff --git a/Questions.cpp b/Questions.cpp index 4e54dbc..17a8c46 100644 --- a/Questions.cpp +++ b/Questions.cpp @@ -10,11 +10,7 @@ #include // For time(0) using namespace std; -void Questions::mainQuestionAsk(int level) { - -} - -bool Questions::determineQuestion(int level) { +bool Questions::mainQuestionAsk(int level) { if((level >= 1) && (level <= 3)) { return countingQuestion(level); } @@ -45,7 +41,7 @@ bool Questions::countingQuestion(int level) { break; } int answer; - countTo++; + countTo++; //To set the possible range to 1 -> maximum, instead of 0 -> (maximum -1) for(int i = 0; i < countTo; i++) { if(countTo % 2 == 0) cout << "X "; diff --git a/Questions.h b/Questions.h index de9b992..792b447 100644 --- a/Questions.h +++ b/Questions.h @@ -2,6 +2,7 @@ Question class header file Jared Sexton ============================================================================ + Currently, questions are configured for levels 1 through 10. */ @@ -10,9 +11,9 @@ class Questions { public: - void mainQuestionAsk(int level); - - bool determineQuestion(int level); + // Asks the proper question based on the player's level. + // It returns true if they answered correctly, and false if not. + bool mainQuestionAsk(int level); // Asks a question, returns true if the kid was right, false if they were wrong. bool countingQuestion(int level); -- GitLab