Question: Write a Java program that will calculate the cost of an airline flight for one customer. Input: ( Using Java dialog boxes ) Flight class:
Write a Java program that will calculate the cost of an airline flight for one customer.
Input: Using Java dialog boxes
Flight class:
int
or
Baggage weight
whole pounds dots
Calculations
All flights include a $ base charge
Determine total cost for flight:
Flight class:
$first class
$business class
$economy class
Determine baggage charge:
If baggage weight is
pounds
then fee is
pounds
$
$
dots. pounds $
dots pounds $
dots pounds $
Tax: on flight cost only excluding base charge and baggage fees
Output: using one Java dialog box
Summary of costs including itemized list with base cost, flight cost, baggage fees, tax, and total
Include errorchecking upstream from calculations and output in the form of a whileloop to validate the
following:
Flight class value input is only a or
Baggage weight is dots
If any input is out of range, provide an error message, "trap" the user in a loop, and give them another
opportunity to reenter input.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
