Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Say you are an aspiring software engineer at an elevator manufacturing company. Generally, an elevator functions like this: (1) The elevator compartment is raised and

Say you are an aspiring software engineer at an elevator manufacturing company. Generally, an elevator functions like this: (1) The elevator compartment is raised and lowered by a hoist and pulley system. (2) A moving counterweight balances the weight of the elevator compartment (for various reasons like conservation of energy). (3) A motor in an elevator can turn the wheel in either direction so that the elevator either goes up or down (with the weight doing the opposite). Basically, what you need to do in this assignment is to emulate this elevator system with the software part focused (using any programming language (e.g., Java and MATLAB/Octave). (a) When you push the button inside the elevator, you activate the motor (let us make a subprogram here such as activate()). (b) When the motor stops, the grooves in the pulley wheel keep the rope in place so the elevator stops moving (maybe another subprogram stop()?). (c) For simplicity and easiness of programming, I will require only a couple of functions here: 1. First, assume we have only three floors the Basement (B), the first floor (1) and the second floor (2). 2. Second, at a normal condition, the elevator is positioned at the Basement (B). 3. Third, we have only two states for the elevator itself: Open (O) and Close (C). 4. Fourth, when someone pushes a button, that button directs the moving of the wheel: Up (U) and Down (D). Say you are at the first floor and want to go to the second floor. Then pushing the button from the first floor activates the motor (activate()) for the elevator to go up (for one floor) and stops the motor (stop()) to stop the elevator at the second floor. 5. Fifth, let us not consider pushing the button from the inside of the elevator and you only consider one passenger pushing one at a time. 6. Sixth, that leaves us about three basic situations: the elevator (E) at the Basement (B) while a passenger is pushing the button from either at the first floor (1) or the second floor (2). Likewise, when the elevator is at the first floor (1), a passenger can push either at the (B) or (2). The same is true with at the second floor. (2)-pushed (2)-pushed E (1)-pushed E (1)-pushed E (B)-pushed (B)-pushed 7. Seventh, let us simplify further by designating U as going up one floor and 2U as going up two floors. In the same fashion, going down one floor is D and the two floors, 2D. 8. Eight, when the elevator reaches the destination, your software opens the door of the elevator (O) and shortly after closes the door (C) and exits the program. Let us go back to the 4th condition again. In this situation, your program shows where the elevator is located: (The Elevator (E) is in B.) And a passenger pushes the button from the first floor to go up to the second floor: (The button is pushed at 1.) Then, the elevator should go to the first floor and open its door. This leads to the series of events: (The Elevator (E) is going up U. The Elevator (E) is now at 1. The Elevator (E) is now open O and C. Elevator is going up again U. The Elevator (E) is now open O and C.

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

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

3rd Edition

0128012757, 978-0128012758

More Books

Students also viewed these Databases questions