A bank uses a computer program during the night to tell if the alarm should be rung. Sensors in the bank set the following Boolean variables:
vaultClosed: set to true if the bank vault is closed; otherwise false

heardNoise: set to true if a microphone heard noise; otherwise false

sawMovement: set to true if a camera saw movement in the bank; otherwise false

The automatic alarm should notify the police if there is noise and movement in the bank, or if the bank vault is open.
Which of the following boolean expressions can be used in a selection statement to ring the alarm?
A. NOT vaultClosed OR (heardNoise AND sawMovement)
B. heardNoise AND vaultClosed
C. NOT vaultClosed AND sawMovement
D. heardNoise AND sawMovement

Respuesta :

Answer:

A. NOT vault Closed OR (heard Noise AND saw Movement)

Explanation:

Boolean expression is an expression which has logical or relational operator and they operate on boolean variables. In the given scenario the the expression used will be NOT vault closed or heard noise and saw movement. This will notify the police when the vault is opened or is tried to be opened. When there is any movement in the vault or when there is some noise the automatic alarm will ring and notify the relevant officials.