Question: . 6. Create a class Elevator that will simulate the operation of an elevator. Here are the details: Assume that for a given elevator, it
. 6. Create a class Elevator that will simulate the operation of an elevator. Here are the details: Assume that for a given elevator, it must keep track of its current floor position. Assume that an elevator will initially start on the first floor An elevator should be able to service a request to move to a specified floor. In servicing a request, the elevator should display a summary of its floor movement. An elevator should also be able to return its current floor position to other program modules. . . I Using your Elevator class, write a C++ program that will use the Elevator class to simulate the operation of three elevators traveling between the 14 and 10th floors of a building, from the perspective of a person waiting for an elevator on the first floor. Use an array to model the three elevators. The program should repeatedly do the following tasks: Display the current positions of each of the three elevators. Ask the user to choose one of the elevators to use (i.e., like pushing the "up" button for one of the elevators - we assume here that each elevator has its own "up" button). If the chosen elevator is not on the first floor, the driver should give the elevator a request to come to the first floor Ask the user which floor she wants (i.e., like pushing the "floor number" button inside the elevator) Send the chosen elevator a request to move to the selected floor
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
