Objectivesto gain experience with arrays to gain

Assignment Help JAVA Programming
Reference no: EM13380045

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: EM13380045

Questions Cloud

The instructor reserves the right to use the resources of : the instructor reserves the right to use the resources of turnitin.com to check for plagiarism in your writing
Virtual private databasesearching web specially oracle and : virtual private databasesearching web specially oracle and microsoft websites and via talking with any database
Evaluate the concept that it is becoming the new core of : evaluate the concept that it is becoming the new core of modern business. how might you justify or negate this
Choose one of the major areas of middleware graphics ai : choose one of the major areas of middleware graphics ai networking sound movie animation physics. research the major
Objectivesto gain experience with arrays to gain : objectivesto gain experience with arrays. to gain experience with generic algorithms.documentationexplain
Investigate examples of software failure and see if you can : investigate examples of software failure and see if you can discern any trends. is the failure-rate getting better or
Erp software and service industryoriginally the sap erp : erp software and service industryoriginally the sap erp software was developed for and implemented by mostly
1 what is the role of the project manager why is : 1. what is the role of the project manager? why is leadership so important for project managers?2. discuss the
Fiction corporation is a large national retail chain of : fiction corporation is a large national retail chain of 10000 employees and 500 retail outlets. fiction is moving its

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