date: Sunday , June 16, 2013(7.00 PM) Eastern
Time Zone (EST)
…I’ll be back in an hour or so…please take your time to give me areasonable price.
Due date: Sunday , June 16, 2013 (7.00 PM) Eastern Time Zone (EST)
Note:
For all assignments, always use comments to explain your program.
You must use the names given to name your program.
Objectives:
To gain experience with Arrays.
To gain experience with generic algorithms.
Documentation:
Explain the purpose of the program as detail as possible – 13%.
Develop a solution for the problem and mention algorithms to be used -16%
List data structures to be used in solution. – 5%.
Give a description of how to use the program and expected input/output – 5%
Explain the purpose of each class you develop in the program. – 5%.
Programming:
For each method, give the pre and post conditions and invariant, if any – 10%
Program execution according to the requirements given 36%
Naming of program as required 5%
Print out of source code 5%
Description of program:
You are to write a program name elevator.java that simulates elevator services in a 12-floor building. There must be one elevator working this building.
Here are some requirements for the program:
The floors of the building are numbered 1 to 12.
The Initialization Phase: Randomly generate 8 floors to stop whilst going UP (No repetitions) and 5 Floors whilst going DOWN (no repetitions). USE ARRAYS :- UPARRAY and DOWNARRAY respectively. If the last stop going up was at floor 10, and a request was made from floor 12 to go down, then the elevator must go up to floor 11 to satisfy that request.
HINT: A good idea is to sort the UPARRAY in ascending order and sort the DOWNARRAY in descending order.
The elevator must be located on the 1st floor and the first request is made which must be a request to go up.
From the 1st floor, the elevator can only go in one direction â up. And from the 12th floor the elevator can only go in one direction â down.
If the elevator is on a given floor and is going down, then it could be used only to go down. Thus the direction…





