subject

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.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:30
Which of the following is an example of intellectual properly! oa. new version of a novelb. journal of ideasc. pages of a bookood. lines of a poem
Answers: 2
question
Computers and Technology, 23.06.2019 20:30
What is the biggest difference between section breaks and regular page breaks
Answers: 1
question
Computers and Technology, 23.06.2019 21:10
Asample of 200 rom computer chips was selected on each of 30 consecutive days, and the number of nonconforming chips on each day was as follows: 8, 19, 27, 17, 38, 18, 4, 27, 9, 22, 30, 17, 14, 23, 15, 14, 12, 20, 13, 18, 14, 20, 9, 27, 30, 13, 10, 19, 12, 26. construct a p chart and examine it for any out-of-control points. (round your answers to four decimal places.)
Answers: 2
question
Computers and Technology, 24.06.2019 17:00
What are some examples of what can be changed through options available in the font dialog box? check all that apply. font family italicizing bolding pasting drop shadow cutting character spacing special symbols
Answers: 2
You know the right answer?
A programmer is creating an algorithm that will be used to turn on the motor to open the gate in a p...
Questions
question
Mathematics, 16.04.2021 02:20
Questions on the website: 13722359