C CODE: create a program that will test the user’s proficiency in solving different types of math problems. The program will be menu-driven. The user will select either addition, subtraction, multiplication, or division problems. The program will then display a problem, prompt the user for an answer, and then check the answer displaying an appropriate message to the user whether their answer was correct or incorrect. The user will be allowed 3 tries at each problem. The program will also keep statistics on how many problems were answered correctly. add functions to allow the user to select problems of varying degrees of difficulty In the next Week, you'll need to add functionality to also keep statistics on the number of correct answers vs. the total number of problems attempted. So now let’s add the code for the remaining functions: We’ll start by inserting code to ask the user if they want to see problems that are easy, medium, or difficult. We’ll do this by prompting them to enter ‘e’ for easy, ‘m’ for medium or 'd’ for difficult and we’ll do this right after they have selected the type of problems they want. We will also add a validation loop that will check to see if they entered a correct response (e,m, or d). Easy – problems using numbers 0 thru 10 Medium – problems 11 thru 100 Difficult – problems 100 – 1000
C CODE: create a program that will test the user’s proficiency in solving different types of math problems. The program will be menu-driven. The user will select either addition, subtraction, multiplication, or division problems. The program will then display a problem, prompt the user for an answer, and then check the answer displaying an appropriate message to the user whether their answer was correct or incorrect. The user will be allowed 3 tries at each problem. The program will also keep statistics on how many problems were answered correctly.
add functions to allow the user to select problems of varying degrees of difficulty In the next Week, you'll need to add functionality to also keep statistics on the number of correct answers vs. the total number of problems attempted.
So now let’s add the code for the remaining functions:
We’ll start by inserting code to ask the user if they want to see problems that are easy, medium, or difficult. We’ll do this by prompting them to enter ‘e’ for easy, ‘m’ for medium or 'd’ for difficult and we’ll do this right after they have selected the type of problems they want. We will also add a validation loop that will check to see if they entered a correct response (e,m, or d).
- Easy – problems using numbers 0 thru 10
- Medium – problems 11 thru 100
- Difficult – problems 100 – 1000
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 9 images