Question: C++ please answer all This project is to develop a program in C++ to control an elevator in a 5-story building The first floor has

C++ please answer all

C++ please answer all This project is to develop a program in

This project is to develop a program in C++ to control an elevator in a 5-story building The first floor has one button, the "up" button, on the panel. The top floor only has the "down" button on the panel. In the elevator car, there are buttons from 1 to 5 indicating floor numbers and a panic button "stop". The program should simulate the process with the following assumptions 1. The elevator needs 10 seconds for any move, up and down, between any two floors. 2. The elevator buttons have higher priority than floor buttons 3. The "stop" button has the highest priority. When the stop button is pressed, the elevator should stop at the nearest floor in its moving direction. 4. The program checks all button statuses in every 2 seconds. 5. At most one button may be pressed in every 2 seconds. 6. The elevator initially stays on the first floor. An input data file should be prepared to simulate the passenger behaviors. Each line has the following binary numbers (0 or 1) separated by spaces. 0 means the button is not pressed. 1 means the button is pressed. Each line represents the status of every 2 seconds. DownU 0 Down4 Down5 Buttn Button2 Button Button4Button Sto 0 0 0 0 0 0 0 The output file should have the floor number of 1,2,3,4,5 representing the floor on which elevator is located at each moment. This project is to develop a program in C++ to control an elevator in a 5-story building The first floor has one button, the "up" button, on the panel. The top floor only has the "down" button on the panel. In the elevator car, there are buttons from 1 to 5 indicating floor numbers and a panic button "stop". The program should simulate the process with the following assumptions 1. The elevator needs 10 seconds for any move, up and down, between any two floors. 2. The elevator buttons have higher priority than floor buttons 3. The "stop" button has the highest priority. When the stop button is pressed, the elevator should stop at the nearest floor in its moving direction. 4. The program checks all button statuses in every 2 seconds. 5. At most one button may be pressed in every 2 seconds. 6. The elevator initially stays on the first floor. An input data file should be prepared to simulate the passenger behaviors. Each line has the following binary numbers (0 or 1) separated by spaces. 0 means the button is not pressed. 1 means the button is pressed. Each line represents the status of every 2 seconds. DownU 0 Down4 Down5 Buttn Button2 Button Button4Button Sto 0 0 0 0 0 0 0 The output file should have the floor number of 1,2,3,4,5 representing the floor on which elevator is located at each moment

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!