Question: Mathtotor2.cpp (20 pts) Write a program that can be used as a math totor for a young student. The program should display a menu allowing

Mathtotor2.cpp (20 pts)

Write a program that can be used as a math totor for a young student. The program should display a menu allowing the user to select one of the four options: 1) Addition, 2) Subtraction, 3) Multiplication or 4) Quit. The program then displays two random numbers between 10 and 50 that will be calculated. After the user has finished the math problem, the program should display the menu again. This process must repeat until the user chooses to quit the program. If the user selects and item not on the menu, the program should print an error message and then display the menu again.

Guidelines:

Need the following preprocessors:

#include

#include

#include

#include

#include

Do

{

Display menu and collect choice;

switch statement

{

Case 1

Case 2

Case 3

Case 4

}

If choice is 1 or 2 or 3

Display the problem with the selected math operator as in the example below

num1

+ num2

-------

If student answer is the same as the correct answer

Send a message: Congratulations! That is right!

Else

Send a message: Sorry, the correct answer is correct answer

} while (choice!= 4);

End of program;

Sample runs:

Menu

1. Addition problem

2. Subtraction problem

3. Multiplication problem

4. Quit this program

1

10

+ 24

---

34

Congratulations! That's right.

Menu

1. Addition problem

2. Subtraction problem

3. Multiplication problem

4. Quit this program

2

11

- 9

---

2

Congratulations! That's right.

Menu

1. Addition problem

2. Subtraction problem

3. Multiplication problem

4. Quit this program

3

33

* 4

---

122

Sorry, the correct answer is 132.

Menu

1. Addition problem

2. Subtraction problem

3. Multiplication problem

4. Quit this program

4

Thank you for using Math Totor.

!!!!! Please use C++

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Lets create a stepbystep program in C that fulfills the given requirements The program involves using several concepts like random number generation s... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!