Display at least the waiting at each floor

Assignment Help JAVA Programming
Reference no: EM13312626

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:

1. The floors of the building are numbered 1 to 12.

2. 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.

3. HINT: A good idea is to sort the UPARRAY in ascending order and sort the DOWNARRAY in descending order.

4. The elevator must be located on the 1st floor and the first request is made which must be a request to go up.

5. 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.

6. If the elevator is on a given floor and is going down, then it could be used only to go down. Thus the direction in which the elevator is going must be known at all times and the floor to which it is going. If the elevator is going up, the request could be anywhere from floor 2 to 12. If it is going down, it can be from 12 to 1, with 1 being the default.

7. The location of the elevator must be known at all times. The program should provide output regarding the current floor, whether the elevator is going up or down, which floor it is starting from and which floor it is going to, as the following output will show:

8. To travel from one floor to another, it will take 2 seconds and the elevator will stay for 3 seconds at each floor.

9. Display at least the waiting at each floor - Flashing the count of the seconds. 


Attachment:- assigment.doc

Reference no: EM13312626

Questions Cloud

Explain the dissolution process completely stops : When a solute reaches its solubility limit in a solvent, the dissolution process completely stops. When a solute has large solubility in a solvent, the two compounds are miscible to each other.
Estimate the capacitance of this human capacitor : You and a close friend stand facing each other. You are as close as you can get without actually touching. If a wire is attached to each of you, estimate the capacitance of this "human capacitor
Depict every stereoisomer for 1-bromo-2-chloro-1 : Draw every stereoisomer for 1-bromo-2-chloro-1,2-difluorocyclopentane. Use wedge-and-dash bonds for the substituent groups, and be sure that they are drawn on the outside of the ring, adjacent to each other
List and explain the 4 pillars of sms : List and explain the 4 Pillars of SMS.
Display at least the waiting at each floor : 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.
Why does the economy fall to pieces after a financial crisis : Why Does the Economy Fall to Pieces after a Financial Crisis - Prepare a powerpoint presentation talking about the document and also prepare an essay paper summarazing the article.
State the organic product(s) of the reaction : Draw the organic product(s) of the reaction of p-methylbenzoic acid with aqueous sodium hydroxide
Compute the moles of ammonia produced : calculate the moles of ammonia produced (e) calculate the partial pressures of all species in the system (f) the total pressure in the system
What is the speed of sound in air : A tuning fork with a frequency of 440 Hz is held just above the top of a uniform glass tube containing water. What is the speed of sound in air

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write prolog clauses to express therelationships

Write prolog clauses to express the following relationships, given the parent relationship: grand-parent, sibling, cousin.

  Create a temperature sensor simulator

create a temperature sensor simulator. First, display a menu that will ask the user what season to simulate (1) winter (2) spring (3) summer (4) fall or (5) to exit. Once the use selects the season your program should ask the user how many simulation..

  Describe the steps to program development

What is the function of parseFloat and parseInt and what will be result if we send "abcd" through a prompt() input and pass it through parseInt()?

  Integers as a parameter and returns the number

Write a method maxOccurrences that accepts a list of integers as a parameter and returns the number the number of times the most frequently occurring integer

  Develop java applet that will help elementary school student

Develop a Java applet that will help an elementary school student learn multiplication. Use the Math.random method or a Random object to produce two positive one-digit integers.

  How to count number of objects (instances) created

How to count number of objects (instances) Created, use java code and please be descriptive

  Statements to create a collection of integers

Write Java statements to create a collection of integers, and to initialize each element of the collection to -1. Then, using a for each statement to print the value of each element.

  Create and code a program that uses three parallel numeric

Create and code a program that uses three parallel numeric arrays of size 6. The program searches one of the arrays and then displays the corresponding values from the other two arrays.

  Infix expression and translate it to a postfix expression

program below is suppose to take in a infix expression and translate it to a postfix expression, but I need a way for the user to be able to input the expression using a scanner and output the postfix.

  Multiple choice java programming questions

Determine which of the following may be a violation of information hiding if inserted for the comment above?

  Define get and set functions and two constructors

Create a class called Building. It will have one data member of type string (used for a postal address). Define get and set functions and two constructors.

  Hypothetical situation

Hypothetical Situation - A company lowers its price of an economy car a small amount   ($15,000 to $14,000) Sales go from 10,000 units to 50,000 units. Another company lowers its price on a luxury car a large amount ($80,000 to $40,000). Its sales go..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd