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 periodis $10.00. Assume that no car parks for longer than 24 hours at a time.
Write a Pythonprogram 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. Themainfunction 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. Thecalculate_chargefunction should return the charge amount based on the argument (hours_parked)it receives.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here