Ask Question
17 December, 04:46

An office building has two floors. A computer program is used to control an elevator that travels between the two floors. Physical sensors are used to set the following Boolean variables. Variable DescriptiononFloor1 Set to true if the elevator is stopped on floor 1; otherwise set to falseonFloor2 Set to true if the elevator is stopped on floor 2; otherwise set to falsecallTo1 Set to true if the elevator is called to floor 1; otherwise set to falsecallTo2 Set to true if the elevator is called to floor 2; otherwise set to falseThe elevator moves when the door is closed and the elevator is called to the floor that it is not currently on. Which of the following Boolean expressions can be used in a selection statement to cause the elevator to move?

+5
Answers (1)
  1. 17 December, 04:49
    0
    Out of the following Boolean expressions, the ones that can be used in a selection statement to cause the elevator to move are 'onFloor1 AND callTo2' or 'onFloor2 AND callTo1'

    Explanation:

    Based on the other commands crafted to be given and received by the lift indicating what operation it is engaged in, the commands to make it move can be determined easily. The command 'onFloor1 AND callTo2' can be used when the lift is on the first floor and needs to be taken to the second floor. The command 'onFloor2 AND callTo1' would work as the counter-command of the command mentioned earlier and would make the lift function exactly in the opposite way.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “An office building has two floors. A computer program is used to control an elevator that travels between the two floors. Physical sensors ...” in 📗 Social Studies if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers