Car Rental Fees




A car rental company uses the following table to help compute rental fees.


Car Type Rate per Day Rate per Mile

Chevrolet 50.00 0.27

Corvette 85.00 0.45

Pontiac 53.00 0.32

Buick 60.00 0.32

Oldsmobile 60.00 0.35

Cadillac 70.00 0.40

Write a program to calculate car rental fees based on this table. The program should prompt the user to enter the name of the type of car that was rented, the number of days the car was rented, and the number of miles the car was driven. The program should search the table for a match on the car type. If there is a match, the rental fee is the number of days rented, times the rate per day, plus the number of miles traveled, times the rate per mile. The program should display the type of car, the number of days rented, the number of miles driven, and the rental fee. If the table search cannot find the car type in the table, display an appropriate error message. Write the program to process any number of rentals.