subject

A car rental company has three types of cars for customers to choose. SUV: $55 per day for first 7 days. $47 per day starting from the 8th day. Minivan: $49 per day for first 7 days. $42 per day starting from the 8th day. Hybrid: $44 per day for first 7 days. $38 per day starting from the 8th day. Write a Python program to do the following. (a) [4 points] Ask user to choose car type. Enter S for SUV, M for minivan or H for hybrid. User may enter uppercase or lowercase letter. Both S and s should be accepted for SUV. Both M and m should be accepted for minivan. Both H and h should be accepted for hybrid. If an invalid car type is entered, display "Invalid car type" and ask the user to reenter repeatedly until a valid car type is entered. (b) [4 points] Ask user to enter number of days. Since user is expected to enter a whole number, it is safe to convert it to an integer. A minimum of 2 days rental is required. If number of days is smaller than 2, display "Must be at least 2 days" and ask user to reenter repeatedly until 2 or larger is entered. (c) [8 points] Calculate and display rental fee. The following is an example: Enter S for SUV, M for minivan, H for hybrid: x Invalid car type. Enter S for SUV, M for minivan, H for hybrid: F Invalid car type. Enter S for SUV, M for minivan, H for hybrid: m Enter number of days: 1 Must be at least 2 days. Enter number of days: 0 Must be at least 2 days. Enter number of days: 8 Rental fee: 385

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 14:30
The “rule of 72” is used to approximate the time required for prices to double due to inflation. if the inflation rate is r%, then the rule of 72 estimates that prices will double in 72/r years. for instance, at an inflation rate of 6%, prices double in about 72/6 or 12 years. write a program to test the accuracy of this rule. for each interest rate from 1% to 20%, the program should display the rounded value of 72/r and the actual number of years required for prices to double at an r% inflation rate. (assume prices increase at the end of each year.)
Answers: 1
question
Computers and Technology, 23.06.2019 14:30
Which of the following would not be considered a pc? a. mainframe b. desktop c. tablet pc d. laptop
Answers: 2
question
Computers and Technology, 24.06.2019 08:30
Intellectual property rights are exclusive rights that protect both the created and the creation. ipr offers exclusively what benefits to the person or people covered by it
Answers: 3
question
Computers and Technology, 24.06.2019 10:00
1. which of these is not true about torsion bars? a. they can be used to adjust ride height b. they can be adjusted anytime since they don't affect alignment angles c. they attach between the frame and the lower control arm d. they twist to produce a spring effect
Answers: 1
You know the right answer?
A car rental company has three types of cars for customers to choose. SUV: $55 per day for first 7 d...
Questions
question
Mathematics, 12.11.2020 18:10
question
Mathematics, 12.11.2020 18:10
question
Biology, 12.11.2020 18:10
question
Mathematics, 12.11.2020 18:10
Questions on the website: 13722363