Commit 77a9a9cc authored by Jared Sexton's avatar Jared Sexton

Updating Questions

parent ead5cb67
......@@ -11,10 +11,10 @@ using namespace std;
int main() {
Questions questionList;
questionList.addSubQuestion(7);
questionList.addSubQuestion(7);
questionList.addSubQuestion(7);
questionList.addSubQuestion(7);
for(int i = 1; i <= 10; i++ ) {
questionList.determineQuestion(i);
cout << "Level Up!\n";
}
return 0;
}
\ No newline at end of file
......@@ -14,11 +14,20 @@ void Questions::mainQuestionAsk(int level) {
}
int Questions::determineQuestion(int level) {
return 0;
bool Questions::determineQuestion(int level) {
if((level >= 1) && (level <= 3)) {
return countingQuestion(level);
}
else if ((level >= 4) && (level <= 10)) {
return addSubQuestion(level);
}
else {
return wordQuestion(level);
}
}
bool Questions::countingQuestion(int level) {
srand(time(0));
int countTo;
switch(level) {
case 1:
......@@ -32,9 +41,11 @@ bool Questions::countingQuestion(int level) {
break;
default:
cerr << "Please see your teacher about your current level.";
return false;
break;
}
int answer;
countTo++;
for(int i = 0; i < countTo; i++) {
if(countTo % 2 == 0)
cout << "X ";
......@@ -83,6 +94,7 @@ bool Questions::addSubQuestion(int level) {
break;
default:
cerr << "Please see your teacher about your current level.\n";
return false;
break;
}
......@@ -138,5 +150,6 @@ bool Questions::addSubQuestion(int level) {
}
bool Questions::wordQuestion(int level) {
cout << "Question type not configured.";
return false;
}
\ No newline at end of file
......@@ -12,7 +12,7 @@ class Questions {
public:
void mainQuestionAsk(int level);
int determineQuestion(int level);
bool determineQuestion(int level);
// Asks a question, returns true if the kid was right, false if they were wrong.
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