Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

We will write a small program for Freedom Airlines to allow the customer to purchase flights, calculating how much the customer owes, taking payment, and

We will write a small program for Freedom Airlines to allow the customer to purchase flights, calculating how much the customer owes, taking payment, and calculating change.

The airline sells tickets for travel during two time periods: daytime (departing 5am-7pm) and nighttime (departing 7pm-5am).

The airline sells tickets for three destinations: Chicago, Miami, and Portland.

The airline sells tickets for two types of days: weekday and weekend (you could use 'D' for weekday and 'E' for weekend).

Pricing information:

For Miami travel, flight prices are as follows:

For weekday travel: $150 during the daytime, $100 during the nighttime

For weekend travel: $180 during the daytime, $120 during the nighttime

Chicago flights cost half the price of Miami flights, and Portland flights cost twice as much as Miami flights. For example, a Portland weekday flight during the nighttime is $200. A Chicago weekend flight during the daytime is $90.

Your program is to work as follows:

1) Display a welcome message (e.g., Welcome to Fordham Airlines!)

2) Prompt the user to input his/her destination: Chicago, Miami, or Portland (I recommend you use letters to represent each input)

3) Prompt the user to input what time s/he wishes to travel (in army time, e.g., 800 for 8am or 1530 for 3:30pm)

4) Prompt the user to input what type of day (s) s/he is traveling: Weekday or Weekend (I recommend you use letters to represent each input)

5) Report the price per ticket of the specified type

6) Prompt the user for the number of tickets to be purchased...If the number of tickets is fewer than 0, report that the number of tickets ordered is invalid and the order has been cancelled, then exit; otherwise

7) Compute and display the total amount due (no sales tax this time!)

8) Prompt the user to enter the amount s/he is paying...If the amount paid is less than the amount due, report that the amount paid is too little and the order has been cancelled, then exit; otherwise:

9) Display change and confirm the order has been placed

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

Step: 3

blur-text-image

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

Graph Databases New Opportunities For Connected Data

Authors: Ian Robinson, Jim Webber, Emil Eifrem

2nd Edition

1491930896, 978-1491930892

More Books

Students also viewed these Databases questions

Question

What do Dimensions represent in OLAP Cubes?

Answered: 1 week ago