CIS211 - Data Structures
Assignment #4

This project requires you to use linked list to implement queues. The Scratchemup Parking Garage contains a single lane which can hold up to 10 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/her car are moved out, his/her 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/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 for the car in the garage. If there is no room for a car, the car waits until there is room or until a departure line is read for the car. When room becomes available, another message should printed. You may check out H:\CIS211\TLU\PROJ4.exe for a demo. You may also copy H:\CIS211\TLU\GARAGE.TXT for input file or create your own.

Bonus Points (7 points)

Modify the program so that a car may be departed from the waiting line instead of the parking garage. You may check out H:\CIS211\TLU\PROJ4BONUS.exe and copy H:\CIS211\TLU\GARAGEBONUS.TXT for input.

Due Date: 3/28/2006 (Tuesday)