C++ Programming Forum

Ask Question   UnAnswered
Home » Forum » C++ Programming       RSS Feeds


  Asked By: Ed    Date: Nov 20    Category: C++ Programming    Views: 1350

San Garage contains two lanes, each of which can hold up to 5 cars. A car which is depart but finds its lane blocked may move into the adjacent lane and exit, if its path is not blocked. The next car to arrive will take its place.

Write a program that processes a group of input lines. Each input line contains an ‘A’ for arrival or ‘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 whenever a car arrives or departs. When a car arrives, the message should specify whether or not there is room for the car in the garage. If there is no room, the car leaves without entering the garage. When a car departs, the message should include the number of times that the car was moved out of the garage to allow other cars to depart.