Solution for the problem and mention algorithms

Assignment Help JAVA Programming
Reference no: EM13188029

Objectives:

  1. To gain experience with Arrays.
  2. To gain experience with generic algorithms.

Documentation:

  1. Explain the purpose of the program as detail as possible
  2. Develop a solution for the problem and mention algorithms to be used
  3. List data structures to be used in solution.
  4. 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.

Programming:

  1. For each method, give the pre and post conditions and invariant, if any 
  2. Program execution according to the requirements given 36%
  3. Naming of program as required 
  4. Print out of source code 

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:

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.

Just a sample example (not ordered)

Up array (NOT SORTED)

4

2

7

9

3

6

8

10

12

5

11

Down array  (NOT SORTED)

3

5

8

9

10

6

                                   Starting at floor 1

                                        Going up: now at floor 2

                                        Going up: now at floor 3

                                        Going up: now at floor 4

                                        Going up: now at floor 5

                                     Stopping at floor 5 for 3 seconds:  1 2 3

                                     Starting at floor 5

                                         Going up: now at floor 6

                                         Going up: now at floor 7

                                         Going up: now at floor 8

                                     Stopping at floor 8 for 3 seconds: 1 2 3

                                     Starting at floor 8

                                         Going down: now at floor 7

                                         Going down: now at floor 6

                                         Going down: now at floor 5

                                         Going down: now at floor 4

                                         Going down: now at floor 3

                                     Stopping at floor 3 for 3 seconds: 1 2 3

                                    Starting at floor 3

                                       Going down: now at floor 2

                                       Going down: now at floor 1

     Do you want to run the elevator again? "Y or y" continue. "N or n" stop.

10.  It must also display the request data structures - requests for going up and down as shown above.

11.  Every time the elevator stops at a floor, it should check the relevant request array to see which floor it should stop next.

12.  Any other functions that you could implement that would make the elevator operation as realistic as possible.

13. Give the user the option to run the program again and again, etc.

Reference no: EM13188029

Questions Cloud

Which country will experience the larger outward shift : Country A and country B produce the same consumption goods and capital goods and currently have identical production possibilities curves. They also have the same resources at present, and they have access to the same technology. Currently, countr..
Explain the average concentration of the pollutant : what wind flow rate entering the canyon would produce a pollutant concentration greater than 0.0025 gmol/ft^3 in the air coming out of the canyon?
Find the distance between a and b : a surveyor locates a point C on land such that CAB = 48.8°. He also measures CA as 317 ft and CB as 527 ft. Find the distance between A and B.
Will the future production possibilities curve for nation : Like Physical capital, human capital produced in the present can be applied to the production of future goods and services. consider the table in Problem, 2-11, and suppose that the nation's residents are trying to choose between combination C and..
Solution for the problem and mention algorithms : Explain the purpose of the program as detail as possible and develop a solution for the problem and mention algorithms to be used and list data structures to be used in solution.
What is the radius of the circle : How long should each piece of the wire be to minimize the total area? What is the radius of the circle? How long is each side of the square?
State what wind flow rate entering the canyon : what wind flow rate entering the canyon would produce a pollutant concentration greater than 0.0025 gmol/ft^3 in the air coming out of the canyon?
Determine coefficient of correlation between two variables : Does the breakfast revenue seem to increase as the number of occupied rooms increases? Draw a scatter diagram to support your conclusion.
State compound sloly isomerizes completely : This compound sloly isomerizes completely to compund B, which has the same formula, Sketch the structures of A and B, and explain why B might be more stable than A

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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