Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For this assignment you will be required to implement an interactive menu, but first you should welcome the user with a one time only welcome

For this assignment you will be required to implement an interactive menu, but first you should welcome the user with a one time only welcome message.
Specific implementation requirements include
This menu will prompt the user to select one of three options.
1- Calculate Greatest Common Denominator
2- Perform Prime Factorization
3- Exit
Your program MUST handle invalid inputs by printing the INVALID_MENU_SELECTION message followed by reprinting the menu.
Once a valid selection is made, your program will print the relevant prompt followed by prompting for the correct number of integers, one line at a time. There will be two prompts for GCD and one for PF.
Your program should print the correct solution to the console then go back to the main menu.
If the user enters an invalid input, print the INVALID_INPUT message and return to the main menu. For GCD all integers must be positive. For PF the integer must be 2 or greater.
For GCD the larger integer could be input either first or last
When the user selects exit, the EXIT_MESSAGE should be printed and the program should end.
The output should match exactly as expected. Use String variables provided in the starter code.
Your program should not crash for any input.
You may not utilize static or multiple Scanner objects.
You may not utilize java.lang.Math for this assignment.
You may not utilize System.exit()
write this in java

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

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions