Computers and Technology

A programmer is creating an algorithm that will be used to turn on the motor to open the gate in a parking garage. The specifications for the algorithm are as follows. The gate should not open when the time is outside of business hours.
The motor should not turn on unless the gate sensor is activated.
The motor should not turn on if the gate is already open.
Which of the following algorithms can be used to open the gate under the appropriate conditions?

Check if the time is outside of business hours. If it is, check if the gate sensor is activated. If it is, check if the gate is closed. If it is, turn on the motor.

Answer A: Check if the time is outside of business hours. If it is, check if the gate sensor is activated. If it is, check if the gate is closed. If it is, turn on the motor.
A

Check if the time is during business hours. If it is, check if the gate sensor is activated. If it is, check if the gate is open. If it is, turn on the motor.

Answer B: Check if the time is during business hours. If it is, check if the gate sensor is activated. If it is, check if the gate is open. If it is, turn on the motor.
B

Check if the time is during business hours. If it is, check if the gate sensor is activated. If it is not, check if the gate is open. If it is not, turn on the motor.

Answer C: Check if the time is during business hours. If it is, check if the gate sensor is activated. If it is not, check if the gate is open. If it is not, turn on the motor.
C

Check if the time is during business hours. If it is, check if the gate sensor is activated. If it is, check if the gate is open. If it is not, turn on the motor.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 08:50, najashohatee1234
Can online classes such as gradpoint track your ip location like if im taking a final and i give somebody else my account and they take the final for me will it show where they are taking the final from? and can this be countered with a vpn
Answers: 1
image
Computers and Technology, 22.06.2019 15:30, micahpauleen748
In a compound condition, both conditions on either side of the logical operator and must be true for the overall condition to be true. a: true b: false
Answers: 1
image
Computers and Technology, 23.06.2019 01:10, kristofwr3444
Are special combinations of keys that tell a computer to perform a command. keypads multi-keys combinations shortcuts
Answers: 1
image
Computers and Technology, 23.06.2019 02:30, noah2o2o
These factors limit the ability to attach files to e-mail messages. location of sender recipient's ability to open file size of file type of operating system used
Answers: 2
Do you know the correct answer?
A programmer is creating an algorithm that will be used to turn on the motor to open the gate in a p...

Questions in other subjects:

Konu
Mathematics, 23.10.2020 19:20
Konu
Mathematics, 23.10.2020 19:20