A parking garage charges a $2.00 minimum fee to park for up to three hours. The
ID: 3634769 • Letter: A
Question
A parking garage charges a $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 hours. The maximum charge foe any given 24-hour period is $ 10.00.Assume that no car parks for longer than 24 hours at a time.Write a program that calculates and print the parking charges for each of three customers who parked their cars in this garage yesterday. You program should enter the hours parked for each customer. Your program should print the results in a neat tabular format and should calculate and print the total of yesterday's receipts.The program should use a function calculate charges to determine the charges for each customer. Your outputs should appear in the following format:Car Hours charges
1 1.5 2.00
2 4.0 2.50
3 24.0 10.00
Total 29.5 14.50
Explanation / Answer
#include #include #include using namespace std; double calculateCharges(double); int main() {int i; double hours[3], thours=0,charge[3],tcharge=0,portions; cout.setf(ios::fixed,ios::floatfield); cout.precision(2); for(i=0;iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.