These are the instructionsYour job at Fancy Car Day Rentals

These are the instructionsYour job at Fancy Car Day Rentals is to produce the rental bill for a fancy rental customer given their mileage driven. The program you write must accept as input the odometer readings at the start and the end of the rental day, the customer's name, and the day of the rental. All cars are returned on the same day they are rented.Here is an example of a dialog with the program (user input is in boldface):Initial odometer reading: 3425
Final odometer reading: 3513
Customer name: Marty McFly
Day number (1=Sun, 2=Mon, etc.): 3
---
The bill for Marty McFly is $411.76
An odometer reading is an integer representing the number of miles the car has been driven since being built. In the example above, Marty McFly drove 88 miles for the day (88 = 3513 - 3425).The week is divided into two parts: the premium days (Friday through Sunday) and non-premium days (Monday through Thursday). The day of the rental determines the billing calculation. During the premium days, the first 30 miles a customer drives is billed at the first tier rate, while any miles driven beyond that is billed at the second tier rate. During the non-premium days, the first 48 miles driven are billed at the first tier rate, and any mileage after that is billed at the second tier rate.The first tier rate is $4.28 on premium days, and $3.12 per mile during non premium days. The second tier rate is $6.55 per mile on both the premium and non-premium days.Since Marty McFly drove 88 miles on a non-premium day, he's billed at a rate of $3.12 per mile for the first 48 miles, and $6.55 per mile for the remaining 40 miles.
Here's another example:Initial odometer reading: 7086
Final odometer reading: 7101
Customer name: James Bond
Day number (1=Sun, 2=Mon, etc.): 7
---
The bill for James Bond is $64.20
James Bond drove 15 miles during a premium rental day, so it was all billed at the first tier rate.

Powered by