Question: CSC140 HOMEWORK 2 UNITED AIRLINES FLIGHT DATA YOUR TASK Write a program to produce a simple flight report for an airline. Here is the basic

CSC140
HOMEWORK 2
UNITED AIRLINES FLIGHT DATA
YOUR TASK
Write a program to produce a simple flight report for an airline.
Here is the basic program output/behavior. Sample user input is highlighted yellow and
underlined below:
Welcome to United Airlines. Please enter flight data:
Enter three-letter code of the departure airport (e.g., ORD): ORD Enter three-letter code of the destination airport: PSP
Enter flight distance in miles: 1979
FLIGHT DATA REPORT: ORD TO PSP ------------------------------------------------------------- TOTAL DISTANCE: 1979 Miles (3166 KM)
ESTIMATED FLIGHT TIME: 3.47 hours
Heres a second test run with different data:
Welcome to United Airlines. Please enter flight data:
Enter three-letter code of the departure airport (e.g., ORD): LAX Enter three-letter code of the destination airport: HND
Enter flight distance in miles: 5471
FLIGHT DATA REPORT: LAX TO HND ------------------------------------------------------------- TOTAL DISTANCE: 5471 Miles (8753 KM)
ESTIMATED FLIGHT TIME: 9.60 hours
Your program will prompt the user for the three-letter codes of both the departure and destination airports, as well as the distance (in miles) between those two airports. You will have to create appropriately named variables of appropriate data types to receive
those values with cin (you can use strings for the airport codes and float or int data for the distance). Note that the values highlighted in yellow above are just sample input values. Your program should work with any values the user enters.
Convert miles to kilometers (kilometers = miles * 1.6) so you can display both values in your flight report.
Calculate the estimated flight time by dividing the distance (in miles) by 570 (which is the average flight speed of a 747 airplane in miles per hour).
Estimated flight time should display to two decimal places. For this you can use the fixed << showpoint << setprecision(2) technique discussed in our book and lecture videos.
ADDITIONAL REQUIREMENTS
Your program must be coded in the standard C++ style shown in our textbook and our
CSC140 online lecture videos.
When you are done, submit your .cpp file through Canvas.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!