Question: I need a python program to do the following. The program cannot be written with functions and must use loops. A car rental company has

I need a python program to do the following. The program cannot be written with functions and must use loops.

A car rental company has three types of cars for customers to choose.

Compact: $30 per day for first 3 days. $26 per day for any additional days.

Mid size: $37 per day for first 3 days. $32 per day for any additional days.

Full size: $45 per day for first 3 days. $38 per day for any additional days.

Write a Python program to do the following.

(a) [4 points] Ask user to choose car type. Enter C for compact, M for mid size or F for full size. User may enter uppercase or lowercase letter. Both C and c should be accepted for compact. Both M and m should be accepted for mid size. Both F and f should be accepted for full size. If an invalid car type is entered, display "Invalid car type. Program ended." and end the program. Otherwise, proceed to part (b).

(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. If 0 or a negative number is entered, display "Invalid number of days. Program ended" and end the program. Otherwise, proceed to part (c).

(c) [12 points] Calculate and display rental fee.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!