Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2.) Parking Fees (parkingfees.cpp, parkingfees.exe) A parking garage charges a EUR 2.00 minimum fee to park for up to three hours. The garage charges an

image text in transcribed
image text in transcribed
2.) Parking Fees (parkingfees.cpp, parkingfees.exe) A parking garage charges a EUR 2.00 minimum fee to park for up to three hours. The garage charges an additional EUR 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 EUR 10.00. Assume that no car parks for longer than 24 hours at a time. Write a program parkingfees.exe that takes the numbers of hours as a command line argument. To provide more functionality, it should also be possible to enter the hours of multiple customers on the command line as well. Your program should print the results in a neat tabular format. There, it should list the hours, the associated fees, the total of the hours and the total of the payments. Represent the numbers using the data type double. Your program should work as displayed below :\UsersIstrobel>parkingfees.exe 1 23 45 Charge 2.00 2.00 2.0 2.5e 3.00 11.50 Car Hours 3.0 4.0 5 TOTAL 15.e Below you find a partially implemented main program. The program should use the function calculateCharges (...) to determine the charge for each customer. A function displayOverview(.) should generate the table. The function displayOverview (..) has been partly implemented already to ensure that the output formatting is consistent. Please test that this is true for your solution as well by performing the following steps: 1. Run "parkingfees.exe 1 2 3 45> myoutput.txt" on the command line (type "parkingfees.exe 1 2 345 myoutput.txt" on the command line without the") compare utility under Windows. The desired result is shown below Users Worbertparkingfees 1234 5 nyoutput2.txt 2. Run "fc myoutput.txt correct.txt" on the command line. The file "correct2.txt" can be downloaded. "fc" is the file Users Norbert>fc nyoutput2.txt correct2.txt onparing files nyoutput2.txt and CORRECI2.TXT C: no differences encountered C+ Code Snippets //your code here //funetion prototypes //your code calculateCharges//your code) //your code displayoverview (//your code): int main (int argc, char argv]) //your code here vector hours(//your code here) //your code here vector charges(//your code here): //your code here displayOverview (hours, charges): return 0: //function definition of displayOverview displayoverview //your code here) ( //your code here cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application And Administration

Authors: Michael Mannino, Michael V. Mannino

2nd Edition

0072880678, 9780072880670

More Books

Students also viewed these Databases questions