cscie160.hw3
Class Building
java.lang.Object
|
+--cscie160.hw3.Building
- public class Building
- extends java.lang.Object
CSCIE160
Assignment 3: Elevator part 3
Building Class
The Building class will simulate the true envirnment of
the Elevator. The Purpose of this is to move main from
Elevator to building class and the array of floors created
separately from Elevator class.
By David Cheung
Method Summary |
static void |
main(java.lang.String[] argv)
Starts the main part of the class, start
with adding passengers in the Elevator and then
add a bunch of passengers on some floors. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
theElevator
public Elevator theElevator
arrayOfFloors
public Floor[] arrayOfFloors
numOfFloors
public int numOfFloors
Building
public Building()
main
public static void main(java.lang.String[] argv)
- Starts the main part of the class, start
with adding passengers in the Elevator and then
add a bunch of passengers on some floors.
Used a FOR loop
to do a 2 round trip sweep. Note: I used a FOR loop instead of
WHILE loop because FOR loop allows me to look at
the data after the program ends. Whereas WHILE loop will
generate a lot of unnecessary data.