Handson Exam
Elevators

Write an Elevator class (Elevator.java) for the following program . An Elevator object represents a typical elevator in a building. An elevator can load and unload passengers, and move up and down the building. Assume that the building that houses these elevators have 5 floors, numbered 1 through 5. The number of passengers allowed in an elevator is dependent on the elevator's total weight limit and the passengers' average weight, which are fixed at 2000 1000 lbs and 123.45 123.5 lbs, respectively. At any point, you would like to be able to find out the current floor the elevator is on, the number of passengers in the elevator, and the elevator's total passenger weight. The up and down methods of the elevator have an int argument representing the number of floors the elevator will move. The load and unload methods also have an int parameter representing the number of passengers entering or leaving the elevator. The elevator must prevent the entry of passengers that cause the total weight limit to be exceeded. For the sample program, this output should result.

Use BlueJ so that you could test your Elevator objects visually. Include the ElevatorSimulation program in the BlueJ project so that you can test and compare against the expected output (Create an ElevatorSimulation class, and then cut and paste the code from the link). You should be able to infer which methods need to be present in the Elevator class from the ElevatorSimulation program. Nevertheless, the methods are:

You do not have to worry about negative-valued parameters. Zip your BlueJ project (name it HO1xxxxxx.zip where xxxxxx is your id number) and submit through moodle