Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem SamaSama Parking Sdn. Bhd. is charging the parking fee for each customer based on the number of hours to park their vehicles. Write a

image text in transcribed

Problem SamaSama Parking Sdn. Bhd. is charging the parking fee for each customer based on the number of hours to park their vehicles. Write a complete program in C++ program to accomplish the following: Ask the user to enter the total hours. Calculates the amount of charges that a customer has to pay using function calcCharges (). Display the amount of charges for a customer. Calculates the total charge of all the customers using function calctotal(). Repeat the process until the user request to stop (You can set any sentinel value). Display total charge of all the customers. Function Description: . main() This function will prompt the user to enter the total hours. Then, it will call function calcCharges()and calcTotal(). The process will repeat until the user enter the sentinel value and then the program then will display the total charge of all customers. calcCharges() This function receives the total hours of parking through its parameter. It then calculates and return the amount of charges to the customer. The formula to calculate the amount of charges is as follows: In the first hour or part thereof, the charge is RM2.00. In the next hours, the additional charge is RM1.00 per hour or part thereof. The maximum charge is RM20.00 calcTotal() This function receives the amount of charges through its parameter. It then calculates the total charge for all the customers and returns the calculated total charge through its parameter

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

Students also viewed these Databases questions