Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You have been asked to develop a java program to simulate the operation of an elevator for a three story building. 1. Write a UML

You have been asked to develop a java program to simulate the operation of an elevator for a three story building. 1. Write a UML class diagram for an elevator. Include private instance variables: int CurrentFloor, bool GoingUp, and bool GoingDown. Also include methods: displayCurrentFloor(), GoUp() and GoDown(). 2. Write an elevator test program. Have the program execute the following steps using the methods in the class: Start on the first floor. Go to the second floor (dont forget to update the Boolean variable GoingUp). Go to the third floor Attempt to go to the fourth floor (Remember: there are only three floors) Go back to the second floor Go back to the first floor Be sure to call displayCurrentFloor() to notify the user which floor the elevator is on at each step

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine Ricardo

2nd Edition

1449606008, 978-1449606008

More Books

Students also viewed these Databases questions