Design a modular program in Python to process parking charges. A parking garage charges $2.00 minimum fee to park for up to three hours. The garage charges an additional $0.50 per hour for each hour or part thereof in excess of three hours. The maximum charge for any given 24-hour period is $10.00. Assume that no car parks for longer than 24 hours at a time. Write a Python program that calculates and displays the parking charges for each customer who parked yesterday and number of customers parked and total charges collected from those customers as well. The program should contain a main function and a calculate_charge function. The main function is to maintain the number of customers and total charges. And also, when there is more customer, the main should prompt user to enter the hours that customer parked, and then call the calculate_charge function to figure out charge to that customer. The calculate_charge function should return the charge amount based on the argument (hours_parked) it receives.
Design a modular
Write a Python program that calculates and displays the parking charges for each customer who parked yesterday and number of customers parked and total charges collected from those customers as well.
The program should contain a main function and a calculate_charge function. The main function is to maintain the number of customers and total charges. And also, when there is more customer, the main should prompt user to enter the hours that customer parked, and then call the calculate_charge function to figure out charge to that customer. The calculate_charge function should return the charge amount based on the argument (hours_parked) it receives.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images