java)Case1: Write a menu driven program that allows you to visit cities of oman in random order with following options. 1: Visit a city              2: Go to previous city                        3: Quit the program When user presses 1: program asks user to enter the city name, and then display that the city has been visited. Please note user can visit a city any number of times When user presses 2: Program takes you back to the previous city When user presses 3: Program terminates See the below example how program interacts with the user:   C:> 1: Visit a city                            2: Go to previous city                                     3: Quit the program Enter your choice … 1 Please enter a city to visit.. Muscat You are in Muscat now…   Enter your choice... 1: Visit a city                                   2: Go to previous city                                     3: Quit the program 1 Please enter a city to visit.. Ibra You are in Ibra now…   Enter your choice... 1: Visit a city                                   2: Go to previous city                                     3: Quit the program 1 Please enter a city to visit.. Sohar You are in Sohar now…   Enter your choice... 1: Visit a city                                   2: Go to previous city                                     3: Quit the program 2 You are in Ibra now…   Enter your choice... 1: Visit a city                                   2: Go to previous city                                     3: Quit the program 1 Please enter a city to visit.. Nizwa You are in Nizwa now…   Enter your choice... 1: Visit a city                                   2: Go to previous city                                     3: Quit the program 2 You are in Ibra now…   Enter your choice... 1: Visit a city                                   2: Go to previous city                                     3: Quit the program 2 You are in Muscat now…   Enter your choice... 1: Visit a city                                   2: Go to previous city                                     3: Quit the program 2 You are back to your original place…   Enter your choice... 1: Visit a city                                   2: Go to previous city                                     3: Quit the program 3 Program terminates…

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 5GZ
icon
Related questions
Question
100%

 

)java)Case1: Write a menu driven program that allows you to visit cities of oman in random order with following options.

1: Visit a city              2: Go to previous city                        3: Quit the program

When user presses 1: program asks user to enter the city name, and then display that the city has been visited. Please note user can visit a city any number of times

When user presses 2: Program takes you back to the previous city

When user presses 3: Program terminates

See the below example how program interacts with the user:

 

C:> 1: Visit a city                            2: Go to previous city                                     3: Quit the program

Enter your choice …

1

Please enter a city to visit..

Muscat

You are in Muscat now…

 

Enter your choice...

1: Visit a city                                   2: Go to previous city                                     3: Quit the program

1

Please enter a city to visit..

Ibra

You are in Ibra now…

 

Enter your choice...

1: Visit a city                                   2: Go to previous city                                     3: Quit the program

1

Please enter a city to visit..

Sohar

You are in Sohar now…

 

Enter your choice...

1: Visit a city                                   2: Go to previous city                                     3: Quit the program

2

You are in Ibra now…

 

Enter your choice...

1: Visit a city                                   2: Go to previous city                                     3: Quit the program

1

Please enter a city to visit..

Nizwa

You are in Nizwa now…

 

Enter your choice...

1: Visit a city                                   2: Go to previous city                                     3: Quit the program

2

You are in Ibra now…

 

Enter your choice...

1: Visit a city                                   2: Go to previous city                                     3: Quit the program

2

You are in Muscat now…

 

Enter your choice...

1: Visit a city                                   2: Go to previous city                                     3: Quit the program

2

You are back to your original place…

 

Enter your choice...

1: Visit a city                                   2: Go to previous city                                     3: Quit the program

3

Program terminates…

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Program on Numbers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning