Hello,
For a while now, I have wanted to build a tutor program to tutor myself. I have a class right now, for each section we cover we are given definitions with their corresponding keywords and such. Its a lot to memorize at times and flashcards are getting old.
I was hoping I could get some direction on how I should tackle such a thing. The way I envision this working is:
At school, say chemistry class -
we begin a chapter 1 and in it involves atoms: we discover electrons, neutrons, protons.
Electron is Negative charge.
Neutron is Neutral charge.
Proton is Positive charge.
We then start on chapter 2 and in this one we have: Avogadro's Number, Moles
Avogadro's Number is equal to 6.022 x 10^23
Mole is a unit of measure used to convert from elementary entities to grams of that substance.
Mind these definitions are simply examples, however they get the point across hah!
I now have 3 definitions from chapter 1 and 2 from chapter 2. With a fictional exam on these definitions approaching, I would like to study them in a randomized fashion! Firstly by chapter, then ultimately an accumulation of both chapters to prep for a final!
I would like to create predetermined questions along with their answers and spit them out to the user based on a certain 'subject' selection from a main menu. These questions would have a "right or wrong" checker, where entering the wrong answer would flag a "Incorrect! the correct answer is: " or if entered correctly a simple "Goodjob!" would suffice and continue on until exit is initiated.
The program I would like to design would go something like this:
1 2 3 4 5 6 7 8 9 10
|
Welcome to Chemtutor! Please select an option from the list or enter '4' to exit:
======
1. Chapter 1 (Atoms)
2. Chapter 2 (Conversion Factors)
3. Accumulation
4. Exit
======
|
Say 1 is selected:
1 2 3 4 5 6 7 8
|
__Chapter 1 (Atoms)___
An electron's charge is:
a. positive
b. negative
c. does not matter
d. neutral
|
if b is entered a "goodjob!" output is displayed followed by the same chart from before
1 2 3 4 5 6 7 8 9 10
|
Welcome to Chemtutor! Please select an option from the list or enter '4' to exit:
======
1. Chapter 1 (Atoms)
2. Chapter 2 (Conversion Factors)
3. Accumulation
4. Exit
======
|
so on and so fourth. However each section would give out a randomized question in its category, and the accumulation would be a combination of both chapters and random as well. I could do boolean and multiple choice questions. However I am not sure the best way to do this. Perhaps arrays of type string? Pointers?
I have made a program similar to this for a c++ class involving math for an elementary student, but not as sophisticated. Also it was with simple numerical inputs and outputs, not strings and such. Here are 2 sections of it for an idea of what I am working towards:
1 2 3 4 5 6 7 8 9 10 11
|
//output of menu to user
cout <<"Menu\n";
cout <<"1. Addition problem\n";
cout <<"2. Subtraction problem\n";
cout <<"3. Mulitiplication problem\n";
cout <<"4. Division problem\n";
cout <<"5. Exit\n";
cout <<"-----------------------------------\n";
cin >> count;
|
Output of Addition problem to user:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
//if statement for addition problem
if(count == 1)
{
//variables declared and assigned
num1 = 1 + rand() % MAX_INT;
num2 = 1 + rand() % MAX_INT;
calculation = num1 + num2;
//output of addition problem and input from user
cout << ADD_TEXT << endl;
cout <<" " << num1 << endl;
cout <<"+" << num2 << endl;
cout <<"------\n";
cin >> answer;
//if statement used to determine if answer from user input is correct or incorrect
if(answer == calculation)
{
cout << CORRECT << endl;
cout <<"-----------------------------------\n";
}
else
{
cout << INPUT << answer << endl;
cout << INCORRECT << calculation << endl;
cout <<"-----------------------------------\n";
}
}
|
the random number generator worked but with numbers from 0-10, also the output was numerical and not string. I tried searching online for something similar but to no avail. Any tips on whether arrays of type string might be a solution or if theres something better suited for this? Maybe this is beyond my level of coding but felt the need to ask. Thanks guys.
-Louie