Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(Please provide screenshots of the code performing its function if you are able to.) The LOWER WEST Parking Garage contains a single lane that holds

(Please provide screenshots of the code performing its function if you are able to.)

The LOWER WEST Parking Garage contains a single lane that holds up to 6 cars. Cars arrive at the south end of the garage and leave from the north end. If a customer arrives to pick up a car that is not the northernmost, all cars to the north of his car are moved out, his car is driven out, and the other cars are restored in the same order that they were in originally. Whenever a car leaves, all cars to the south are moved forward so that at all times all the empty spaces are in the south part of the garage.

Write a C++ program that reads a group of input lines. Each line contains an 'a' for arrival or a d' for departure and a license plate number. Cars are assumed to arrive and depart in the order specified by the input. The program should print a message each time that a car arrives or departs. When a car arrives, the message should specify whether or not there is room in the garage for the car. If there is no room for a car, the car then proceeds to the UPPER WEST garage...which is similar to the LOWER WEST

There is room for 6 cars at the UPPER WEST Garage. Now...if both garages are filled up, cars wait in the EAST PARKING GARAGE near the LOWER WEST garage for a space..and of course they are queued up here as well. EAST can hold only five cars. If more than 6 cars try to wait in EAST the cars are told to go to MAIN CAMPUS.

So in summary...when a car arrives it tries to park in the LOWER WEST

If no room it goes to the UPPER WEST...If still no room it waits in EAST

When a car departs a message should indicate where it departed from (i.e. which garage) If there is a car waiting to get in the garage (because both are full) then the first car in the EAST must be moved into the garage that now has room and a message stating this must appear.

When a car exits either WEST garage (but NOT EAST) the parking fee must be also be displayed as follows:

If the car is at the front of the queue, fee is $0, if second in the queue $10, if third or further back, $25.

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

Practical Issues In Database Management A Refernce For The Thinking Practitioner

Authors: Fabian Pascal

1st Edition

0201485559, 978-0201485554

More Books

Students also viewed these Databases questions

Question

10. Are you a. a leader? b. a follower? _______

Answered: 1 week ago