Question
Write a program that will help an elementary school student learn math. The program should ask the user to pick a type of arithmetic problem
Write a program that will help an elementary school student learn math. The program should ask the user to pick a type of arithmetic problem to study.Option 1 means addition problems, 2 means subtraction problems, 3 means multiplication problems, and 4 means division problems. If user picks 5,
program should randomly pick one of the options 1-4 and entering 6 should end the program. The program should also allow the user to enter a difficulty level. At a difficulty level 1, the program should use only single-digit numbers in the problems, at a difficulty level 2, numbers as large as two digits, and so on.
The program should prompt the user with a question, such as
How much is 6 times 7?
The student then inputs the answer. If the answer is correct, program displays one of the following messages:
Very good!
Nice work!
Keep up the good work!
(Use rand () function to choose a number from 1 to 4 that will be used to select one of the four messages to each correct answer)
If the answer is wrong, program displays one of the following messages:
No, please try again.
Wrong, try once more.
Dont give up!
No, keep trying.
(Use rand () function to choose a number from 1 to 4 that will be used to select one of the four messages to each incorrect answer)
Let the student try the same question repeatedly until the student gets it right.
Your program should have at least four functions: one to display the menu, one to generate questions, one function randomly chooses response to correct answer, and one function randomly chooses response to incorrect answer.
Do not use global variables. Be sure the user only selects 1- 6 when selecting an item from the menu.
Sample run:
Math teacher Menu
Enter 1 for addition problem
Enter 2 for subtraction problem
Enter 3 for multiplication problem
Enter 4 for division problem
Enter 5 for a combination of 1 through 4
Enter 6 to quit this program
Enter your choice (1-6): 1
Enter difficulty level: 2
How much is 83 plus 27? 100
No. Please try again.
? 102
No. Keep trying.
? 110
Very good!
Math teacher Menu
Enter 1 for addition problem
Enter 2 for subtraction problem
Enter 3 for multiplication problem
Enter 4 for division problem
Enter 5 for a combination of 1 through 4
Enter 6 to quit this program
Enter your choice (1-6): 5
Enter difficulty level: 1
How much is 5 minus 3? 2
Math teacher Menu
Enter 1 for addition problem
Enter 2 for subtraction problem
Enter 3 for multiplication problem
Enter 4 for division problem
Enter 5 for a combination of 1 through 4
Enter 6 to quit this program
Enter your choice (1-6): 6
Thank you for using Math teacher.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started