Question
Python The program will compute and display information for a company which rents vehicles to its customers. For a specified customer, the program will compute
Python
The program will compute and display information for a company which rents vehicles to
its customers. For a specified customer, the program will compute and display the
amount of money charged for that customers vehicle rental.
1. The program will repeatedly prompt the user to enter the following four items for a
given customer (in the specified order):
a. The customer's classification code (a character)
b. The number of days the vehicle was rented (a number)
c. The vehicle's odometer reading at the start of the rental period (a number)
d. The vehicle's odometer reading at the end of the rental period (a number)
It will then process that customer information and display the results. It will halt when the
user enters Q(or q) instead of a classification code.
2. The program will compute the amount of money that the customer will be billed, based
on the customers classification code, number of days in the rental period, and number of
miles driven.The program will recognize both upper case and lower case letters for the
classification codes.
Code 'B' (budget)
base charge: $40.00 for each day
mileage charge: $0.25 for each mile driven
Code 'D' (daily)
base charge: $60.00 for each day
mileage charge: no charge if the average number of miles driven per day is 100
miles or less; otherwise, $0.25 for each mile driven above the 100 mile per day limit.
The amount billed to the customer is the sum of the base charge and the mileage charge.
3. For each customer, the program will display a summary with the following information:
a. The customer's classification code
b. The number of days the vehicle was rented
c. The vehicle's odometer reading at the start of the rental period
d. The vehicle's odometer reading at the end of the rental period
e. The number of miles driven during the rental period
f. The amount of money billed to the customer for the rental period
4. When an invalid classification code is detected, the program will display an error
message.
Note:
Use the built in input function to take input from the user. For example, the following code
will take a string from the terminal and assign that to the variable name.
name = input("Please input your name: ")
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started