Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

Assignment

This Is Elevator Object-Oriented Design

PROBLEM

You are to create an object-oriented design for simulating the behavior of an elevator. Your design should consist of an appropriate use case diagram (with scenarios), class diagram, and interaction diagram in UML. We will assume that there is a single elevator for all floors.

The following entity types shall be part of this design:

• ElevatorCar (which the passengers ride in)
• ElevatorDoor (opens and closes)
• CallButton (on each floor to request an elevator)
• SelectFloorButton (in the elevator car, one button for each floor)
• EmergencyButton (in elevator,rings buzzer if elevator gets stuck)
• Controller (which controls all the actions of the elevator)
• Buzzer
• Elevator Requests Queue

All buttons light up at the appropriate times. When a CallButton is first pressed, it should light up, and turn off when the elevator reaches the floor that the call was from. Likewise, a SelectFloorButton should light up the first time pressed, and turn off when the elevator car reaches the desired floor. The EmergencyButton lights up when pressed, and stays lit.

The elevator dooropens and closes at the appropriate times. When a SelectFloorButton is pressed, the elevator door should close. When an elevator reaches the requested floor (to either drop off or pick up someone) the elevator door should open.

ASSUMPTIONS

We will make the following simplifying assumptions:

1. There is no more than one passenger in the elevator at any given time, and thus only one SelectFloorButton is ever pressed at a time. Also, there is no need for separate up/down call elevator buttons on each floor (just one call button), since elevators will not stop to pick up waiting passengers when transporting a riding passenger.

2. Each request for an elevator (when a call button is pressed from a particular floor) is queued, because of our assumption that only onepassenger is carried at a time.

3. There are no open/close door buttons on the elevator. This action is completely under the control of the controller.

UML DIAGRAMS
Use Case Diagram

There will be two actors in the use case diagram: a waiting passenger and a riding passenger. A waiting passenger is a person wanting to ride on the elevator, waiting on a specific floor. A riding passenger is a person currently on the elevator, being transported to the requested floor.

Following are the use cases to include:

Waiting Passenger

• Request Elevator

Person on a given floor -presses call buttonfor that floor to request the elevator

Riding Passenger

• Select Floor

Person on elevator -presses a select floor buttonto go to a particular floor

• Call for Help

Person on elevator -presses the emergency call button for help when elevator stuck

Class Diagram

There will be the following classes in the design, with the indicated methods:

• ElevatorCar

-moveUp() causes elevator car tomove up to the next floor
- moveDown() causes elevator car tomove down to the next floor
- getFloor() reports the floor elevator car currently on

• ElevatorDoor

- open() causes elevator door to open
- close() causes elevator door to close

• Button (abstract class)

- press() abstract method
- lightOn() concrete method(causes Button light to turn on)
- lightOff() concrete method(causes Button light to turn off)

• SelectFloorButton(of type Button)

- press()passes reference to itself to controller

• CallButton(of type Button)

- press()passes reference to itself to controller

• EmergencyButton (of type Button)

- press()rings buzzer when pressed

• Buzzer

- ring()

• Controller

-floorRequest(Button) moves elevator to indicated floor

if Button of type SelectFloorButton, immediately request elevator to move to request floor
if Button of type CallButton, then add request to RequestQueue

- queueFloorRequest(num) queues request

this is a PRIVATE method of the Controller class

• RequestQueue

- isEmpty() returns true of queue empty, otherwise returns false
- enqueue(num) adds requested floor number to the queue
- dequeue() returns floor number at front of the queue

All button classes should be subclasses of the abstract Button class. Make sure to also consider including in the class diagram navigation, multiplicity, composition and aggregation, as appropriate.

Interaction (Sequence) Diagram

There will be three interaction diagrams (one for each use case):

• The Call Elevatorinteraction diagram begins when a CallButton is pressed.

• The Select Floor interaction diagram begins when a SelectFloorButton is pressed.

• The Request Help interaction diagram begins when an EmergencyButton is pressed.

Note-Diagrams must be done using a UML-capable drawing tool such as Lucidchart, Dia, ArgoUML, Visio, or Eclipse plugin, exported to pdf.

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M92477866

Have any Question?


Related Questions in Programming Language

Assignment task -q1 a the fibonacci numbers are the numbers

Assignment Task - Q1. (a) The Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and are characterised by the fact that every number after the first two is the sum of the ...

Assignmentquestion onegiving the following code snippet

Assignment Question One Giving the following code snippet. What kind of errors you will get and how can you correct it. A. public class HelloJava { public static void main(String args[]) { int x=10; int y=2; System.out.p ...

Question - create a microsoft word macro using vba visual

Question - Create a Microsoft Word macro using VBA (Visual Basic for Applications). Name the macro "highlight." The macro should highlight every third line of text in a document. (Imagine creating highlighting that will ...

Extend the adworks applicationi add dialogs to allow the

Extend the AdWorks application I. Add Dialogs to allow the user to Add, Edit, Read and Delete a Customer and refresh the view accordingly. 1. The user should be able to select a specific customer from the DataGrid and cl ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

1 write a function named check that has three parameters

1. Write a function named check () that has three parameters. The first parameter should accept an integer number, andthe second and third parameters should accept a double-precision number. The function body should just ...

Structs and enumsoverviewin this task you will create a

Structs and Enums Overview In this task you will create a knight database to help Camelot keep track of all of their knights. Instructions Lets get started. 1. What the topic 5 videos, these will guide you through buildi ...

Assignment - haskell program for regular expression

Assignment - Haskell Program for Regular Expression Matching Your assignment is to modify the slowgrep.hs Haskell program presented in class and the online notes, according to the instructions below. You may carry out th ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Question 1 what is hadoop explaining hadoop 2 what is

Question: 1. What is Hadoop (Explaining Hadoop) ? 2. What is HDFS? 3. What is YARN (Yet Another Resource Negotiator)? The response must be typed, single spaced, must be in times new roman font (size 12) and must follow t ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As