Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

Introduction Ahmad is managing a car parking garage. Ahmad is responsible for allowing cars to enter the parking and collecting payments when cars leave. Write

image text in transcribed
Introduction Ahmad is managing a car parking garage. Ahmad is responsible for allowing cars to enter the parking and collecting payments when cars leave. Write a C++ program that helps Ahmad manage the parking more efficiently. Once the user (Ahmadj runs the program, the program shall ask the user to enter the price of parking per hour. This price will be used to calculate the amount that shall be collected by Ahmad when a car leaves the parking garage. Then, the program shall provide the user with the following options by showing a menu. The user can choose one of these options by entering its number 1. 2. 3. 4. Once the user is done with one operation, the program shall show the menu again to allow the user to execute another operation. Ahmad shall be able to execute as many operations as he wants. Tips Cars are charged for whole hours. For example, if a car stays in the garage for 15 minutes, the car will be charged the price of one hour. And if a car stays in the garage for 1 hour and 5 minutes, the car will be charged the price of two hours. . Parking slots are numbered using a combination of characters and numbers. An example of parking slot number is A-123C . You do not have to maintain the list of parking slots in your application. The user can enter any number (Eg. A-123C) when asked to enter a parking slot number You shall use hash tables for storing reservations. The key to be used is parking slot number Available Options 1. Check-in Car: This option is executed whenever a car enters the parking garage. When the user chooses this option, the program shall ask the user to enter the car plate number and the parking slot number. The program shall determine the current time by calling the function getCurrentTime() function that is already implemented inside the template file. This function will return the number of minutes since 12:00 AM. Once the user enters this data, the program shall check if the parking slot is available. If it is available, the program shall reserve the parking slot, and show a message that slot has been reserved. Otherwise, the program shall show an error message that parking slot is already busy. 2. Print Parking Slot Info: When the user chooses this option, the program shall ask the user to enter the parking slot number. Then, the program shall show whether the parking slot is available. It is available. the program shall also show how long the car has been in the parking slot, as well as the amount due for the parking slot 3. Checkout Cat: This option should be executed when a car leaves the parking. When the user chooses this option, the program shall ask the user to enter the parking slot number. Then, the program shall show how much money shall be collected. Once executed, this operation shall make the parking slot available for other cars. 4. Print Total Income: When the user chooses this option, the program shall show how much money was collected so far. It aims at checking whether Ahmad has the right amount of money in his pocket 5. Print Cars in Parking: When the user chooses this option, the program shall print the plate number of each car that is already in the parking garage. This operation shall also print the parking sit number and how long the car has been in the parking garage

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_2

Step: 3

blur-text-image_3

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

Online Market Research Cost Effective Searching Of The Internet And Online Databases

Authors: John F. Lescher

1st Edition

0201489295, 978-0201489293

More Books

Students explore these related Databases questions