Commit ec4c6a1f authored by Eddy Marinez's avatar Eddy Marinez

Merge branch 'master' of gitlab.cs.wallawalla.edu:sextja/cptr142_group_project

parents 7dfffad1 cba7cbc5
......@@ -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. mainQuestionAsk(i);
cout << "Level Up!\n";
}
return 0;
}
\ No newline at end of file
......@@ -10,15 +10,20 @@
#include <ctime> // For time(0)
using namespace std;
void Questions::mainQuestionAsk(int level) {
}
int Questions::determineQuestion(int level) {
return 0;
bool Questions::mainQuestionAsk(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 +37,11 @@ bool Questions::countingQuestion(int level) {
break;
default:
cerr << "Please see your teacher about your current level.";
return false;
break;
}
int answer;
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 ";
......@@ -83,6 +90,7 @@ bool Questions::addSubQuestion(int level) {
break;
default:
cerr << "Please see your teacher about your current level.\n";
return false;
break;
}
......@@ -138,5 +146,6 @@ bool Questions::addSubQuestion(int level) {
}
bool Questions::wordQuestion(int level) {
cout << "Question type not configured.";
return false;
}
\ No newline at end of file
......@@ -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);
int 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);
......
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