The Smart Parking Fee Calculator project was designed by Leigh Anne Fitz of Virginia Beach City Public Schools and the autograding tests were designed by Kate McDonnell of Cherry Creek Schools in Colorado.
A downtown parking garage wants to replace its manual parking-fee system with a Python program. The program will ask a customer for information about their parking visit and determine how much they owe. The garage has different rates depending on how long the customer parked and whether they are a garage member. The program should also determine whether the customer qualifies for free parking.
Create a Python program that determines a customerβs parking fee based on information they provide. Your program should make decisions using Boolean expressions and display a personalized receipt. Be sure to format all dollar amounts in the receipt to two decimal places.
Inputs:
Customer name: Morgan
Hours parked: 3
Are you a member? no
Is today a weekend? no
Inputs:
Customer name: Jordan
Hours parked: 5
Are you a member? yes
Is today a weekend? yes
Inputs:
Customer name: Alex
Hours parked: 0.5
Are you a member? no
Is today a weekend? no
Inputs:
Customer name: Taylor
Hours parked: 14
Are you a member? no
Is today a weekend? no
------------------------------
RECEIPT
------------------------------
Customer: Morgan
Parking Time: 3.0 hours
Customer Type: Regular
Parking Fee: $10.00
Weekend Discount: $0.00
------------------------------
Amount Due: $10.00
------------------------------
Thank you for parking with us!
------------------------------
RECEIPT
------------------------------
Customer: Jordan
Parking Time: 5.0 hours
Customer Type: Member
Parking Fee: $12.00
Weekend Discount: $2.40
------------------------------
Amount Due: $9.60
------------------------------
Thank you for parking with us!
------------------------------
RECEIPT
------------------------------
Customer: Alex
Parking Time: 0.5 hours
Customer Type: Regular
Parking Fee: $0.00
Amount Due: $0.00
Your parking visit is free!
------------------------------
RECEIPT
------------------------------
Customer: Taylor
Parking Time: 14.0 hours
Customer Type: Regular
Parking Fee: $25.00
Amount Due: $25.00
WARNING: You have exceeded the
recommended 12-hour parking time.
Project2.14.1Smart Parking Fee Calculator.
Create a Python program that determines a customerβs parking fee based on information they provide. Your program should make decisions using Boolean expressions and display a personalized receipt. Be sure to format all dollar amounts in the receipt to two decimal places in print using round(num, 2) or format(num, ".2f").
Describe a selection statement that you used in your app. What was the condition and what happened when the condition was true or false? How did you test both branches of the selection statement to make sure it was working correctly?
Describe an error that you encountered while you were creating the code, and how you fixed your code to remove the bug. How did you test the code to make sure it was working correctly?