Question: Write a Java program that asks teh user if they want to stop. The user enters 1 for YES, 2 for NO, and 3 for
Write a Java program that asks teh user if they want to stop. The user enters 1 for YES, 2 for NO, and 3 for MAYBE. You may assume the user does not enter any value other than 1, 2, or 3. If the user enters NO or MAYBE, the program continues asking the user if they want to stop, until they enter YES. Once the user enters YES, the program then asks the user if they are sure they want to stop. If the user enters YES again, the program terminates, but if the user enters NO or MAYBE, the program goes back to asking the user if they want to stop. Here is a sample run:
--------------------------------------------------------------------------------------------
Do you want to stop? 2
Do you want to stop? 3
Do you want to stop? 2
Do you want to stop? 1
Are you sure you want to stop? 2
Do you want to stop? 3
Do you want to stop? 3
Do you want to stop? 1
Are you sure you want to stop? 3
Do you want to stop? 1
Are you sure you want to stop? 1
Bye!
--------------------------------------------------------------------------------------------
public static void main(String [] args) {
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
