Create a class Elevator that will simulate the operation of an elevator. Here are the details: ·…
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. Using your Elevator class, write a C++ program that will use the Elevator class to simulate the operation of three elevators traveling between the 1st 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. Here is output from a sample run of the program (user input in bold): Elevator Status A B C 1 1 1 Which elevator do you want (1=A, 2=B, 3=C, or other to exit)? 1 Which floor do you want? 3 Starting at floor 1 Going up – now at floor 2 Going up – now at floor 3 Stopping at floor 3 Elevator Status A B C 3 1 1 Which elevator do you want (1=A, 2=B, 3=C, or other to exit)? 3 Which floor do you want? 5 Starting at floor 1 Going up – now at floor 2 Going up – now at floor 3 Going up – now at floor 4 Going up – now at floor 5 Stopping at floor 5 Elevator Status A B C 3 1 5 Which elevator do you want (1=A, 2=B, 3=C, or other to exit)? 2 Which floor do you want? 4 Starting at floor 1 Going up – now at floor 2 Going up – now at floor 3 Going up – now at floor 4 Stopping at floor 4 Elevator Status A B C 3 4 5 Which elevator do you want (1=A, 2=B, 3=C, or other to exit)? 3 Starting at floor 5 Going down – now at floor 4 Going down – now at floor 3 Going down – now at floor 2 Going down – now at floor 1 Stopping at floor 1 Which floor do you want? 6 Starting at floor 1 Going up – now at floor 2 Going up – now at floor 3 Going up – now at floor 4 Going up – now at floor 5 Going up – now at floor 6 Stopping at floor 6 Elevator Status A B C 3 4 6 Which elevator do you want (1=A, 2=B, 3=C, or other to exit)? 9
May 04 2022 09:53 AM
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more