Question
A Madison Square Garden street parking Attendantcharges $8.00 minimum fee to park for up to 5 hours.The Attendant charges an additional $2.25 per hour for
A Madison Square Garden street parking Attendantcharges $8.00 minimum fee to park for up to 5 hours.The Attendant charges an additional $2.25 per hour for each hour in excess of five hours. In addition, an extra $10 is charged if it's a commercial vehicle.The maximum charge for any 24-hour period, for any type of vehicle is $50.75 .privide program that calculates and prints the parking chargesfor each of three customerswho parked their cars with the Madison Square Garden street parking Attendant.The program should use the following functions:
getCustomerNameAndHoursParked():a void function that asks for the employee'sfull nameand Number ofHours Parked.Use pass-by-referenceto send these two items to main().
isVehicleCommercial():a value returning function that asks if vehicle is commercial and returnstrueorfalse.
calcCharges():a value returning function that calculates and returns the charge for each customerto main().
The main()function should display the customer's full name, an indication of whether vehicle is commercial,hours and charge for each customerto an output file (report.txt).
Sample Output:(User input in red)
Enter Customer Name:Susan Smith
Enter Hours Parked:1.5
Is vehicle commercial (Y/N)?Y
Enter Customer Name:Franklin Ball
Enter Hours Parked:4.0
Is vehicle commercial (Y/N)?N
Enter Customer Name:Francis Smith
Enter Hours Parked:8.0
Is vehicle commercial (Y/N)?N
OUTPUT FILE: report.txt -- The program should generate output program in the following formaat:
CustomerHoursChargeCommercial
Susan Smith1.518.00Y
Franklin Ball4.08.00N
Francis Smith8.014.75N
- Use a for loop to prompt the user for their full name and number of hours parked and if vehicle is commercial for each of the three customers.
- The variables for all charges and number of hours should be of typedouble.
- FunctioncalculateCharges()should use a nestedif/elsestructure to determine the customer charge.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started