A flight company computes the ticket price of a travel depending on the reservation rate and the seat class. Write a program that asks the user to enter the airplane capacity, the number of reserved seats and the seat class (E for Economy and B for Business). The program must compute and display the reservation rate and the ticket price using the following formulas and rules: Reservation rate = number of reserved seats *100 / airplane capacity The ticket price is given by the following table: %3D Business class Economy class If reservation rate less than or equal to 40% If reservation rate is between 40% and 85% If reservation rate is 85% or more 200$ 350$ 550$ 150$ 220$ 400$

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 1CP
icon
Related questions
Question
We need to use java program
A flight company computes the ticket price of a travel depending on the reservation rate and the seat class.
Write a program that asks the user to enter the airplane capacity, the number of reserved seats and the seat
class (E for Economy and B for Business). The program must compute and display the reservation rate and
the ticket price using the following formulas and rules:
Reservation rate = number of reserved seats *100 / airplane capacity
The ticket price is given by the following table:
Business class Economy class
If reservation rate less than or equal to 40%
If reservation rate is between 40% and 85%
If reservation rate is 85% or more
200$
350$
550$
150$
220$
400$
Note: if the user enters a class other than B or E the program must display:
"Sorry!! We don't have this class"
Enter the plane capacity and number of reserved seats: 820 120
Enter the seat class(B for business): E
Run 1
Reservation rate = 14%. The ticket price = 200$
Enter the plane capacity and number of reserved seats: 204 90
Enter the seat class B for business) B
Run 2
ctiv
Parje
Reservation rate
Enter the nlanë.
o to
350$
neserved
Coats 120 195
75°F Sunny
Transcribed Image Text:A flight company computes the ticket price of a travel depending on the reservation rate and the seat class. Write a program that asks the user to enter the airplane capacity, the number of reserved seats and the seat class (E for Economy and B for Business). The program must compute and display the reservation rate and the ticket price using the following formulas and rules: Reservation rate = number of reserved seats *100 / airplane capacity The ticket price is given by the following table: Business class Economy class If reservation rate less than or equal to 40% If reservation rate is between 40% and 85% If reservation rate is 85% or more 200$ 350$ 550$ 150$ 220$ 400$ Note: if the user enters a class other than B or E the program must display: "Sorry!! We don't have this class" Enter the plane capacity and number of reserved seats: 820 120 Enter the seat class(B for business): E Run 1 Reservation rate = 14%. The ticket price = 200$ Enter the plane capacity and number of reserved seats: 204 90 Enter the seat class B for business) B Run 2 ctiv Parje Reservation rate Enter the nlanë. o to 350$ neserved Coats 120 195 75°F Sunny
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Class
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