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

  Creates a professorraing class

Write a program that creates a professorRaing class consisting of professor ID and three ratings. The three ratings are used to evaluate easiness, helpfullness, and clarity. In a separate implementation class, allow the user to enter the values.

  Hasanodddigit that returns whether any digit

d named hasAnOddDigit that returns whether any digit of a positive integer is odd. Your method should return true if the number has at least one odd digit and false if none of its digits are odd. 0, 2, 4, 6, and 8 are even digits, and 1, 3, 5, 7, 9 a..

  Allow the user to display a work history report

The 'report screen' shall:Allow the user to display a work history report for an individual or for all employees for the two weeks prior to the report request.

  Statements to print a label

Add the statements to print a label in the following format (the numbers in the example output are correct for input of $4.25 per pound and 41 ounces). Use the formatting object money to print the unit price and total price and the formatting object ..

  Write a class called rationalnumber

Write a class called RationalNumber that represents a fraction with an integer numerator and denominator.

  Modify the scholarship application

Modify the Scholarship application so that if a user enters a grade point average under 0 or over 4.0, or a negative value for either of the activities, an error message appears.

  Java script program for song

Construct a JavaScript program that declares and prints an array that includes at least twenty of your favorite songs.

  Java application which creates bank records

Write down a java application which creates 10000 bank records and the allow user ti enter a balance and customer account info. using a an account number.

  Write a recursive method to reverse a string.

write a recursive method to reverse a string. Explain why you would not normally use recursion to solve this problem?

  What is the average response time for this system?

A web server receives a request every 50ms and processes web requests every 8 ms. Using queuing theory, 1. What is the average response time for this system?

  Discuss key environmental issues facing north america

Discuss the key environmental issues facing North America based on the discussion in the text. Which ones do you see threatening the quality of life in North America the most? Do you have any ideas on how these issues might be addressed?

  Explain we have to make a project in java

We have to make a project in java . This is a small deskstop application no specifications given so far . The CD store has CD games and music we can rent a cd or we can buy . This is all we need to develop.

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