Write a C++ console application that calculates and displays the charges for multiple customers using a parking garage. The parking garage charges a minimum fee of $3.00 to park for up to three hours. The garage charges an additional $0.85 per hour or fraction of an hour for parking over three hours. The maximum charge for any given 24-hour period is $20.00. You may assume that no car parks for longer than 24 hours at a time.
Your program will use a function named calculateCharges to determine the charges based on the amount of time the car was parked. Your program will prompt the user for the number of hours parked in the garage. It will then display the parking charges for that transaction. Keep track of the number of transactions as well as accumulating the number of hours parked and the parking charges. Your program will execute repeatedly until the user enters a value for the number of hours parked that is less than or equal to zero. Your program will then display the number of transactions and totals for the number of hours parked and the parking charges.
`Hey,
Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.
#include <iostream>
using namespace std;
double calculateCharges(int n)
{
double amt=0;
if(n<3)
return 3.0;
else
amt=3.0+0.85*(double)(n-3);
if(amt>20)
return 20;
return amt;
}
int main()
{
int n;
cout<<"Enter hours: ";
cin>>n;
while(n!=0)
{
double amt=calculateCharges(n);
cout<<"Charges are: $"<<amt<<endl;
cout<<"Enter hours: ";
cin>>n;
}
return 0;
}

Kindly revert for any queries
Thanks.
Write a C++ console application that calculates and displays the charges for multiple customers using a...
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 in excess of these initial three hours. The maximum charge for any given 24 hour period is $10.00. Assume no car parks for longer than 24 hours at a time. Write a program that calculates and prints the total parking charges for the customers who parked their cars in this garage (at least 4 cars) and the...
Objective: The objective of this lab is to get familiar with the syntax of the Java programming language. This lab is designed to reinforce programming concepts. Instructions: Description of the Problem. 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 three hours. The maximum charge for any given 24-hour period is $10.00. Assume that no car parks...
A parking garage has 5 customers daily. The garage charges a $5.00 minimum fee to park up to two hours. The garage charges an additional $1.00 per hour for each hour (or part of an hour) over two hours. The maximum charge for any given day is $12.00. All cars are gone by midnight. Write a program to calculate and print a summary of the charges for a day. For input the program will read the hours of usage for...
Write a program in C An international airport offers long term parking at the following rates: First 60 minutes is free; 61-80 minutes $4; Each additional 20 minutes $2; And $18 max. per day (24 hours). Write a program longterm_parking.c that calculates and prints the charges for parking at the long term parking garage. 1. The user enters the number of total hours and minutes; the program prints the charge. 2. If the input is invalid, print a message and...
Travel Expenses Create a GUI in C# Visual Studios application that calculates and displays the total travel expenses of a business person on a trip. Here is the information that the user must provide: • Number of days on the trip • Amount of airfare, if any • Amount of car rental fees, if any • Number of miles driven, if a private vehicle was used • Amount of parking fees, if any • Amount of taxi charges, if any...
I need help with this C++ code for my programming class. Thank You! You own EasyButCostly Parking Garage. Write a program to calculate the parking fees based on the number of hours a car is parked in your EasyButCostly Parking Garage. You will read in the number of hours from the user into a variable of type double and output the parking fees. The parking fees are charged as follows: Hours Fees up to 5 $10 more than 5 but...
Write a JavaFX program to solve the following problem. Two buttons appear at the top side by side. When the Park button is clicked, a small car drives from the right side onto the road and parks in the garage. The garage can hold five cars. When the Unpark button is clicked, the bottom car drops down from the garage, drives left, drives up, and drives right off the screen. A car is designed, minimally as rectangle on two circular...
creat a GUI APPLICATION that calculates and displays the total travel expenses of a business person on a tripmhere is the information that a user provide:-number ofdays on the trip,amount of airfare,amount of car rental fees,if any,number of miles driven,if the private vehicle was used,amount of parking fees,amount of taxicharges,conference or seminar fees,lodging charges per night.The company reimburses trevel expenses according to following policy:$37 per day for meals,parking fees,upto $10 per day,taxi charges up to$ 20.00per week.lodging charges up to...
Assignment: My friend, Cary Parker, owns a small parking garage downtown. She wants you to write a program to help her calculate the parking charge at the payment booth. The price to park in the lot is $5.50 per hour, plus city parking tax. However, partial hours (even one minute into an additional hour) are charged at the full hour’s rate. For example, if you park for exactly 60 minutes, or less, you will pay $5.50 plus tax, but if...
Write a program to run the following methods in C#. 2) Write a method that takes in a teacher’s last name and exam number via parameters. Ask the teacher (using her name) to tell you the highest score on that exam. Your question should look something like “Ms. Jones, what was the highest grade on test two?” Return the value of the highest grade to the calling method. 3) Write a function called MinOfThree that takes in three numbers and...