package csc241.samples.parkingGarage; /* File: garage.java Author: Mohammadi Last Update: 10/22/02 */ /** ~mohammad/public_html/classes/csc241/samples/garage.java garage is a Canvas and needs a 200X350 area to draw correctly. A garage consists of 5 carRows. With the first holding any type of car, 4th one holding red cars and the 5th one the black cars only. We never put a longer staying car in fornt of a shorter staying car. **/ import java.awt.*; import csc241.samples.Stack.*; public class garage extends Canvas { protected static final Color backGroundColor = Color.white; protected static final int redRow = 3; protected static final int blackRow = 4; protected static final int row1 = 0; protected static final int row2 = 1; protected static final int row3 = 2; protected static final int rows = 5; protected static final int carsPerRow = 10; /** rows of cars **/ carRow [] c_; /** Build carRows array. **/ public garage () { setBackground(backGroundColor); setSize(210,350); c_ = new carRow [rows]; for (int i=0;i