Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in java . . 5. Write code in main that: Displays a menu with the different destination cities Prompts user for destination city Reads and

in java image text in transcribed
image text in transcribed
. . 5. Write code in main that: Displays a menu with the different destination cities Prompts user for destination city Reads and stores destination city selection Prompts user for number of checked and carry-on bags Reads and stores number of checked and carry-on bags Displays o Destination city Flight cost o Baggage cost o Total cost See output section below for example runs of the code . 6. The code must handle invalid user selections for: Destination city selection in the menu If an invalid destination city is entered in the menu The code MUST print a message and END PROGRAM Number of checked/carry-on bags selected If an invalid number of checked bags is entered - The code MUST print a message and END PROGRAM If an invalid number of carry-on bags is entered The code MUST print a message and END PROGRAM Note: End program means: once an input error occurs, the program must display an error message and perform no more processing For example: If the user enters o when asked to select a destination city, the program must display an error message and complete execution. At this point, the code must NOT ask the user for the number of checked or carry-on bags. See output examples #3 and 4 belbw. . . Assignment Description Create a "very" simple airline reservation program that allows the user to select a destination city and the number of bags they will be taking. The program displays the cost of the flight, cost of the baggage, and total cost of the trip. The program must handle invalid user selections as described in specification #6 below. Assume the following for this Airline Reservation program: The program will process only 1 traveler The airline flies only from Denver to the 4 cities stated in the table below. The customer can select only one destination city. The fares are fixed as stated in the table. Destination City Sydney, Australia London, England Frankfurt, Germany Cabo San Lucas, Mexico Fare $1750.00 $1300.00 $1450.00 $550.00 . The airline allows the following options for baggage: 0 to 4 checked bags, and 0 to 1 carry-on bags The airline charges the following for baggage: Checked bag. $25.00 per bag Carry-on bag - $35.00 per bag

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_2

Step: 3

blur-text-image_3

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

Structured Search For Big Data From Keywords To Key-objects

Authors: Mikhail Gilula

1st Edition

012804652X, 9780128046524

More Books

Students also viewed these Databases questions

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago