We have to use rand() to get 2 numbers in random each time and ask student to find the correct solution.. First we start with numbers 1 to 6.If we get 4 and 5 then the program will ask "how much is 4 times 5 4x5 = " Then the student will be able to give the answer, If it is correct then it will be typed on screen "Correct" otherwise "wrong" The student would be able to repeat it for 10 times until he finds the correct answer, If he fails then it will appeared on screen "You have to remember that 4 times 5 is 20!"
i)We have to use rand() also for 4 choices when the student give a correct answer "Very good, Congratulation, Bravo, Correct"
Also we use rand() for wrong answer "wrong, try again, give another answer, surly you know it try again"
ii) if the percentage of the correct answers is 75% of the 10 questions, then it will take us to the next level from 7 to 9. it continues to next level from 10 to 60 and the next level from 70 to 90.
iii) The student should be able to test himself in addition, subtraction, multiplication, division giving integer (we use positive numbers).
SOLUTION This solution is FREE courtesy of BrainMass!
Please find attached C source code. The program operates as follows:
For up to 4 levels of difficulty we give a student in a loop 10 tasks. On each task he has 10 attempts to give a correct answer. Level can be raised only when 75% of correct answers are achieved.
Please note that for Division only whole numbers are accepted as results. If result must be rounded down. For example 1 div 2 = 0; 5 div 2 = 2.
The output may look like:
=============== Welcome to Math Test Program ===========================
[E] End Program
Selection [A, S, M, D, E]:A
How much is 1 plus 5 = 3
How much is 1 plus 5 = 2
How much is 1 plus 5 = 6
Selection [A, S, M, D, E]:E.© BrainMass Inc. brainmass.com September 27, 2022, 4:44 pm ad1c9bdddf>