Problem

In a two-story building a company has one elevator. We want to write a simulator for this...

In a two-story building a company has one elevator. We want to write a simulator for this elevator so that the building designers can study the elevator system.

By each door on each floor there is a button to call the elevator. You decide what (if any) displays should be provided for the user. There are buttons in the car for door open, door close, and an alarm button. You will have to decide what outputs are needed from the simulator so that a user can see and understand what is happening in the simulation.

Identify the main objects in this situation. Identify the behavior of each object: Decide how the several objects interact. Then identify the classes and the member functions. Then identify the state that the class(es) must remember to be able to control the elevator.

We suggest a clock-driven simulation where everything happens on a clock tick (of say one second, but your program will not have any timing. A click will just be one execution of a loop.) You call a random-number generator to decide how many people arrive on each floor at each tick.

Design and code a simulation of the building’s elevator.

This is not a hard exercise, but it requires clear thinking. It also requires that you supply some of the details we have left out such as the bell ringing on arrival at a floor, and the door opening, just to mention two things.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 20