Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Say you are an engineer at an elevator manufacturing company. Generally, an elevator works like this: (1) the elevator compartment is raised and lowered by

Say you are an engineer at an elevator manufacturing company. Generally, an

elevator works like this: (1) the elevator compartment is raised and lowered by a

hoist and pulley system (2) and a moving counterweight balances the weight of

the elevator compartment (for various reasons like conservation of energy). Let us

assume that 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),. When

you push the button inside the elevator, you activate the motor. When the motor

stops, the grooves in the pulley wheel keep the rope in place so the elevator stops

moving. You are to build an algorithm for a new elevator to be installed at the

Arts and Science building at Lewis University. For simplicity and easiness of

program, I will only a couple of conditions:

1. First, we have only one elevator in a three-story building (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.

3. Third, we have only two states for the elevator: Open (O) and Close (C).

4. Fourth, one 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 for the elevator to go up (for one floor).

5. Fifth, let us not considen pushing the button from the inside of the elevator

and you only consider one passenger pushing at one time.

6. Sixth, that leaves us about three basicsituations: the elevator (E) at the

Basement (a) whille a passengerlis pushing the button from elther at the

first floor (1) or the second floor (2). Lukewlse, when the elevator is at the

first floor (1l), a passenger can push etther at the (B) or (2). The same ls true

with at the second floor.

2)-pushed

(2)-pushed

(1)-pushed

(1-pushed

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 algorithm 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 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, and going up assume that completing this task is good enough for your elevator algorithm at this point You are free to do more for extra credits but I just need to see your program doing above-mentioned tasks Please send me the source code you designed (55 points).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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