Вы находитесь на странице: 1из 2

Bob’s Car Rental Bill Calculator

Intermediate project
If this much is completed correctly, student will receive a B (80-89%)

Note: additions from basic are highlighted in yellow

Use a sentinel value loop.

Ask each user for:

• Type of vehicle (May use something other than strings, such as: 1 for economy, 2 for sedan, etc.) • Days
rented
• Full tank?

Detail calculations (output for each customer):


• Rental cost o Use integer / and % to determine weeks and days
• Fuel charge
• subtotal
• Taxes
• Total due

Rental Charges: 3 types of vehicle rentals


Vehicle Weekly rate Daily Rate

economy 158.80 31.76

sedan 201.60 40.32

SUV 237.80 47.56

Note:

• all weekly rates are 5 times the daily rates o You may use a constant, or just calculate this off the daily rental fee

• only whole day units to be considered (no hourly rates)


• charge the weekly rate for all whole weeks rented o for example: 14 days would be twice the weekly rate

• charge the daily rate for less than whole weeks o for example: 3 days would be three times the daily rate

• exceptions: o for periods more than a week but not a multiple of 7, charge the appropriate number at the
weekly rate, and then the appropriate number at the daily rate
 for example: 17 days should be charged 2 weekly rates, and also 3 daily rates o If daily
charge is for 6 days (regardless of the weeks) charge the weekly rate (which is lower than 6 times
the daily rate).
 Example: 13 days would be twice the weekly rate rather than the weekly rate + 6 daily
rates.

Fuel charges:

If the tank is not full when vehicle is returned, the customer is charged a $40.00 fuel fee

Taxes:

6% sales tax on total bill

Summary Data:
• Number of customers
• Total fuel charges
• Total taxes collected
• Total money collected
• Average bill

Additional notes:
• Include IPO, algorithm, and desk check values (design documents)
• Source code file should contain o Proper comments at beginning o Proper style

 Indentation and general formatting


 Variable names
 Inline comments as needed
• Running program should o Have readable and understandable output with
 Spaces, dollar signs, appropriate decimals, etc.
• Use declared constants for the three daily rates, as well as fuel charge and tax rate
• Provide data validation loops on input items o Type of vehicle o Fuel tank full o Days rented

Grade scoring: (maximum 89% overall)


• 75% - does your code run and produce correct results
• 15% - design documents
• 10% - format and style

Вам также может понравиться