Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

pls help me with my homework. tq in advance 1. The program will compute and display information for a company which rents vehicles to its

image text in transcribed

image text in transcribed

image text in transcribed

pls help me with my homework. tq in advance

1. 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 customer's vehicle rental. 2. 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 (an integer) c. The vehicle's odometer reading at the start of the rental period (an integer) d. The vehicle's odometer reading at the end of the rental period (an integer) 3. 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. 4. The program will compute the amount of money that the customer will be billed, based on the customer's classification code, number of days in the rental period, and number of miles driven. And display the total charge Sample Output Please enter your full name: Syed Muslim Jameel Please enter your rental classification code (i.e. B for budget, D for Daily, and W for weekly): W How many days did you rent your vehicle for? 21 What was your vehicle's initial odometer reading (in kms)? 5000 What was your vehicle's final odometer reading (in kms)? 8000 Summary: Name of vehicle renter: SYED MUSLIM JAMEEL Number of days vehicle rented: 21 Initial odometer reading on rented vehicle: 5000 kms Final odometer reading on rented vehicle: 8000 kms Number of kilometres driven during rental period: 3000 Final billing cost: $800.00 Charges Details Code 'B' (budget) base charge: $40.00 for each day mileage charge: $0.25 for each mile driven Hint 1: if classCode == 'B': # For budgeted rental baseCharge = 20 * daysRented kmCharge 0.30 * kmDriven totalCharge baseCharge + kmCharge 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. Hint 2: # Calculation of average Kms elif classCode == 'D': avgKmPerDay = kmDriven / daysRented driven per day during rental period baseCharge = 50 * daysRented if avgKmPerDay

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions