Question: Language: C++ Write a program that calculates a customers monthly bill for a fractional ownership jet service. In a fractional ownership jet service, the customer

Language: C++

Write a program that calculates a customers monthly bill for a fractional ownership jet service. In a fractional ownership jet service, the customer gets the benefits of having a private jet, but only pays for the portion of time theyre using the jet.

Our fractional jet ownership provider has three different packages for its customers:

Package A: For $100,000 per month, 50 hours of flight are provided. Additional hours are $4,000.00 per hour. However, if more than 50% of the flight hours used by the customer occurs on the weekend, the additional hours are only $3,500 per hour.

Package B: For $150,000 per month, 100 hours of flight are provided. Additional hours are $3,500 per hour. There is no discount for weekend usage.

Package C: For $250,000 per month, 200 hours of flight are provided. Additional hours are $2,000 per hour. There is no discount for weekend usage.

Your program should prompt which package the customer has purchased and how many hours are used. In addition, if the customer purchased Package A and has used more than the allowed 50 hours, the program should additionally prompt if the customer used more than 50% of the flight hours on the weekend. However, if the customer did not purchase Package A or did purchase Package A but used 50 flight hours or less, do not ask the question about weekend usage.

When asking for the package, the program should expect a single upper or lower case A, B, or C. However, the program should tolerate invalid input from the user. In particular, if the user of the program just hits without providing an A, B, or C, the program should print a message to the user and terminate. Or, if the user enters a character other than A, B, or C, the program should print a message to the user and terminate. However, if the user enters additional text following the A, B, or C, the program should ignore that additional text and continue processing. For example, if the user enters ASTUFF as the purchased package, your program should interpret that input to mean the customer purchased package A and ignore the remaining text.

When asking for the number of hours used, the program should expect an integer. The program must ensure the entered value is non-negative. If the user enters additional text following the integer or enters a floating point number, the program should ignore that additional text or fractional value and continue processing.

When asking about weekend usage, the program should expect an upper or lower case Y or N. It should print a message if the user didnt enter either Y or N and should ignore any additional characters following the Y or N.

With all this input, the program should calculate the monthly charge for the user and display that value, with the $ currency symbol and always with two decimal places, to the screen.

Additionally, if the customer purchased Package A, the program should calculate the costs for Package B and Package C and display the savings if the customer had purchased Package B and/or Package C if and only if Package B or Package C would save the customer money. If both Package B and Package C would save the customer money, display the savings for both packages. Or, if the customer purchased Package B, the program should calculate the cost for Package C and display the savings if the customer had purchased Package C, if and only if, Package C would save the customer money.

Documentation

The first line of the source code should be a comment including the following information: // CS 1336.002 Project 2

In addition, your program should have a header comment describing the purpose of the program and overall flow of the program.

Further, your program should have comments within the code describing the purpose of each logical section within the program.

Sample Runs

The captures show two sessions running the program. Note the instructor has chosen to output additional information to aid the user and confirm what was input. That is encouraged.

Enter A, B, or C to indicate the plan purchased by the user:

A - $100,000.00 per month with 50 flight hours. $4,000.00 per additional flight hour, but only $3,500.00 per additional flight hour if 50% or more of the flight hours was used on weekends.

B - $150,000.00 per month with 100 flight hours. $3,500.00 per additional flight hour.

C - $250,000.00 per month for 200 flight hours. $2,000.00 per additional flight hour.

A You selected Package: A Please enter the number of flight hours used by the customer (should be a whole, non-negative number): 52 You entered: 52 flight hours Did the customer use 50% or more of the flight hours

on the weekend? (Y/N) N Customer will receive a weekend discount: false The customer's cost for the month is $108000.00

Enter A, B, or C to indicate the plan purchased by the user:

A - $100,000.00 per month with 50 flight hours. $4,000.00 per additional flight hour, but only $3,500.00 per additional flight hour if 50% or more of the flight hours was used on weekends.

B - $150,000.00 per month with 100 flight hours. $3,500.00 per additional flight hour.

C - $250,000.00 per month for 200 flight hours. $2,000.00 per additional flight hour.

ABCDEF You selected Package: A Please enter the number of flight hours used by the customer (should be a whole, non-negative number): 350.999999999 You entered: 350 flight hours Did the customer use 50% or more of the flight hours

on the weekend? (Y/N) Y Customer will receive a weekend discount: true

The customer's cost for the month is $1150000.00 Customer would have saved $125000.00 on Package B

Customer would have saved $600000.00 on Package C

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!