Question: Purpose Java looping and format output implementations Program Specifications: You are to design a math tutoring program that can be used as a math tutor

Purpose
Java looping and format output implementations
Program Specifications:
You are to design a math tutoring program that can be used as a math tutor for a young
student. This program will display a menu allowing user to select an addition, a subtraction,
or a multiplication problem. The last selection on the menu should let user exit the program.
The menu looks like the following:
Math Tutoring Game
Addition
Subtraction
Multiplication
Exit the Game
Here are the steps to play the game:
The program will prompt the user to enter a selection
The program then displays two random numbers between 10 and 50 that are to be
either added, subtracted, or multiplied such as:
36+27
-.-.---
The program should wait for the user to enter the answer. If the answer is correct, a
message of congratulation should be printed. If the answer is incorrect, a message
should be printed showing correct answer.
After user has finished the math problem, the program should display the menu
again. This process is repeated until the user selects the choice (4) to exit the
program.
Input Validation: If the user selects an item not on the menu, display an error
message and display the menu again.
To Solve this problem, we can identify IPO and develop the Pseudocode.Purpose
Java looping and format output implementations
Program Specifications:
You are to design a math tutoring program that can be used as a math tutor for a young
student. This program will display a menu allowing user to select an addition, a subtraction,
or a multiplication problem. The last selection on the menu should let user exit the program.
The menu looks like the following:
Math Tutoring Game
1. Addition
2. Subtraction
3. Multiplication
4. Exit the Game
Here are the steps to play the game:
1. The program will prompt the user to enter a selection
2. The program then displays two random numbers between 10 and 50 that are to be
either added, subtracted, or multiplied such as:
36
+27
-------
3. The program should wait for the user to enter the answer. If the answer is correct, a
message of congratulation should be printed. If the answer is incorrect, a message
should be printed showing correct answer.
4. After user has finished the math problem, the program should display the menu
again. This process is repeated until the user selects the choice (4) to exit the
program.
5. Input Validation: If the user selects an item not on the menu, display an error
message and display the menu again.
To Solve this problem, we can identify IPO and develop the Pseudocode.
Input Menu selection
User answer
Processing Use random number to generate 2 numbers between 10 and 50
(inclusive)
Generate math problem from 2 random numbers and user selected
operation
Prompt for user answer and check user answer for correctness
Repeat the process until user select (4) exit the program
Output Display message about users answer
Lab Assignment 3
COSC-1436 Programming Fundamentals I Java
Variables menuSelection, firstNum, secondNum, userAnswer, correctAnswer all
variables are int type
Constants final int MIN =10, MAX =50;
- the range of random number
Random num To generate random number, use Math.random() method
To generate number in range 10-50 inclusive: Use constant MIN and MAX
MIN +(int)(Math.random()*(MAX-MIN+1))
Pseudocode 1. Start a looping structure
2. Display menu (See above menu display)
3. Prompt user to enter menu selection: (1-4)
4. Validate menu selection
5. Display proper message for invalid selection or Exit the Game selection
6. Generate random numbers between 10-50 inclusive
7. Display problem (See above problem display)
8. Prompt user to enter answer
9. Check user answer to see if it is correct and display proper message
10. Repeat the same process until user selects (4) to exit the program
Purpose Java looping and format output

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!