Answered step by step
Verified Expert Solution
Question
1 Approved Answer
ocumentation: detail as possible-8% I. Explain the purpose of the program as 2. Develop a solution for the problem and mention algorithms to be used-12%
ocumentation: detail as possible-8% I. Explain the purpose of the program as 2. Develop a solution for the problem and mention algorithms to be used-12% 3. list data structures to be used in solution. _ 5% 4. Give a description of how to use the program and expected input/output-5% 5. Explain the purpose of each class you develop in the program,-5% Programming I. 2. 3. For each method, give the pre and post conditions and invariant, if any-10% Program execution according to the requirements given-50% Naming of program as required-5% Description of program: You are to write a program name elevator.java that simulates one elevator services in a 12-floor building. NOTE: There is only one elevator working this building Here are some requirements for the program: 1. The floors of the building are numbered 1 to 12 2. At the start of the program, randomly generate 8 of the 12 floors to stop at while going up. These must be placed in an ArrayList which should be sorted in ascending order. Also generate another set of 5 numbers representing floors to stop at whern going down and place it in another ArrayList Sort this Arravtist in descending order 3. Also at the start of the program the elevator must be located on the 1st floor and the first request is made from the ArrayList which must be a request to go up 4. From the 1st floor, the elevator can only go in one direction - up. And from the 12* floor the elevator can only go in one direction - down. For the other floors, the elevator can go in either direction i.e. if it is going down when you get on and you want to go up and the down ArrayList is empty, then the elevator could start going up from that floor. The same will be true if the elevator is going up when you get on, and you want to go down and the up AayList is empty, then it can start going down from that floor
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started