Commit d6d145f2 authored by Jared Sexton's avatar Jared Sexton

Creating question class

parent c2967515
/* ============================================================================
Question class function file
Jared Sexton
============================================================================
*/
void mainQuestionAsk(int level);
int determineQuestion(int level);
bool countingQuestion(int level) {
switch(level) {
case 1:
int countTo = rand % 5;
break;
case 2:
int countTo = rand % 10;
break;
case 3:
int countTo = rand % 20;
break;
default
cerr << "Please see your teacher about your current level.";
break;
}
int answer;
for(int i = 0; i < countTo; i++) {
if(countTo % 2 == 0)
cout << "X ";
else
cout << "# ";
}
cout << "How many symbols are there?";
cin >> answer;
if(countTo == answer) {
cout << "Good job!";
return true;
}
else
cout << "Better luck next time.";
return false;
}
void addSubQuestion(int level);
void wordQuestion(int level);
\ No newline at end of file
/* ============================================================================
Question class header file
Jared Sexton
============================================================================
*/
#include <iostream>
class Questions {
void mainQuestionAsk(int level);
int determineQuestion(int level);
// Asks a question, returns true if the kid was right, false if they were wrong.
bool countingQuestion(int level);
void addSubQuestion(int level);
void wordQuestion(int level);
};
......@@ -41,7 +41,7 @@
| --------------------------------- | ------------- | --------- |
| Create class "Teacher" | Person | March 9 |
| Create class "Student" | Person | March 9 |
| Create class "Questions" | Jared | March 9 |
| Create class "Questions" | Jared | March 9 |
| Structure the File I/O | Person | March 4 |
| Compile main code | Person | March 11 |
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