Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions