Commit cba7cbc5 authored by Jared Sexton's avatar Jared Sexton

Updating Question Class

parent 77a9a9cc
...@@ -12,7 +12,7 @@ int main() { ...@@ -12,7 +12,7 @@ int main() {
Questions questionList; Questions questionList;
for(int i = 1; i <= 10; i++ ) { for(int i = 1; i <= 10; i++ ) {
questionList.determineQuestion(i); questionList. mainQuestionAsk(i);
cout << "Level Up!\n"; cout << "Level Up!\n";
} }
......
...@@ -10,11 +10,7 @@ ...@@ -10,11 +10,7 @@
#include <ctime> // For time(0) #include <ctime> // For time(0)
using namespace std; using namespace std;
void Questions::mainQuestionAsk(int level) { bool Questions::mainQuestionAsk(int level) {
}
bool Questions::determineQuestion(int level) {
if((level >= 1) && (level <= 3)) { if((level >= 1) && (level <= 3)) {
return countingQuestion(level); return countingQuestion(level);
} }
...@@ -45,7 +41,7 @@ bool Questions::countingQuestion(int level) { ...@@ -45,7 +41,7 @@ bool Questions::countingQuestion(int level) {
break; break;
} }
int answer; int answer;
countTo++; countTo++; //To set the possible range to 1 -> maximum, instead of 0 -> (maximum -1)
for(int i = 0; i < countTo; i++) { for(int i = 0; i < countTo; i++) {
if(countTo % 2 == 0) if(countTo % 2 == 0)
cout << "X "; cout << "X ";
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
Question class header file Question class header file
Jared Sexton Jared Sexton
============================================================================ ============================================================================
Currently, questions are configured for levels 1 through 10.
*/ */
...@@ -10,9 +11,9 @@ ...@@ -10,9 +11,9 @@
class Questions { class Questions {
public: public:
void mainQuestionAsk(int level); // Asks the proper question based on the player's level.
// It returns true if they answered correctly, and false if not.
bool determineQuestion(int level); bool mainQuestionAsk(int level);
// Asks a question, returns true if the kid was right, false if they were wrong. // Asks a question, returns true if the kid was right, false if they were wrong.
bool countingQuestion(int level); bool countingQuestion(int level);
......
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