2
Answers

Car park fee

Steve  Miles

Steve Miles

11y
2.7k
1

An car park charges a €5.00 minimum fee to use the car park for up to three hours.  The car park charges an additional €1.0 per hour for each additional hour or part thereof.  The maximum charge for any given session is €15.00.  .

Write a program that calculates and displays the charges for each customer who uses the car park.  Your program will accept the hours used by each customer.  The program will display the charge for each customer and a running total for all usage. The program will have at least one method that calculates the charge for each customer.

Sample Dialoge:

Hello, welcome to the car park app

 

Enter number of hours (-999 to quit) : 2

Customer Charge : 5.00

Total Receipt    5.00

 

Enter number of hours (-999 to quit) : 3

Customer Charge : 5.00                                 

Total Receipt    10.00

 

Enter number of hours (-999 to quit) : 4

Customer Charge : 6.00                                 

Total Receipt    16.00

 

Enter number of hours (-999 to quit) : 5

Customer Charge : 7.00                                 

Total Receipt    23.00

 

Enter number of hours (-999 to quit) : 10

Customer Charge : 12.00                               

Total Receipt    35.00

 

Enter number of hours (-999 to quit) : 20

Customer Charge : 15.00                   

Total Receipt    50.00

 

Enter number of hours (-999 to quit) : 21

Customer Charge : 10.00                   

Total Receipt    35.00

 

Enter number of hours (-999 to quit) : -999

GoodBye

Answers (2)