Question: This program is designed to practice random number generation within a range, nested logic, if/else statements and the switch statement. make a program that can

This program is designed to practice random number generation within a range, nested logic, if/else statements and the switch statement.

make a program that can be used as a math tutor for a young student. code the solution for Addition, Subtraction, Multiplication and Quit. (Division will be coded in a later assignment and utilize loops to ensure there is no remainder.)

Show the user a menu and ask the user to enter a number 1 through 5

  1. Addition
  2. Subtraction
  3. Multiplication
  4. Division
  5. Quit

Ask the user to enter a choice from the menu.

Use a switch statement to branch depending on the user's choice. For now, develop a solution for addition, subtraction and multiplication.Test and debug the solution.

For Addition:

The program should display two random numbers that are to be added, such as:

247

+21

The program should wait for the student to enter the answer. If the answer is correct, a message of congratulations should be printed. If the answer is incorrect, a message should be printed showing the correct answer. Assume the top number is between 100 and 999. The bottom number is between 10 and 99.

For Subtraction:

The program should display two random numbers that are to be subtracted, such as:

45

-2

The program should wait for the student to enter the answer. If the answer is correct, a message of congratulations should be printed. If the answer is incorrect, a message should be printed showing the correct answer. Assume the top number is between 10 and 99. The bottom number is between 1 and 9.

For Multiplication:

The program should display two random numbers that are to be multiplied, such as:

11

x4

The program should wait for the student to enter the answer. If the answer is correct, a message of congratulations should be printed. If the answer is incorrect, a message should be printed showing the correct answer. Assume the top number and the bottom number are between 1 and 12.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Programming Questions!