1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
baherus [9]
3 years ago
5

A bank uses a computer program during the night to tell if the alarm should ring. 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 boolean expressions can be used in a selection statement to ring the alarm?
Computers and Technology
1 answer:
Snowcat [4.5K]3 years ago
5 0

Answer:

(vaultClosed OR (heardNoise AND sawMovement))

Explanation:

The first step is to understand the conditions that must be satisfied to alarm notifies the police.

"The automatic alarm should notify the police IF there is noise and movement in the bank, or <u>IF</u> the bank vault is open".

The first IF (bold), sets the first condition which is formed by two sub-conditions: "noise AND movement". The word AND is very important because both sub-conditions must be satisfied, if there is noise but no movement, the the whole condition is not satisfied and the alarm does not notify, and vice versa.

The second IF (underlined), sets the second condition and is about the bank vault is open.

In conclusion, there are two ways to alarm notify the police.

  1. There is noise and movement (must be both)
  2. The bank vault is open

As can be either, the operator OR is used.

(condition 1) OR (condition 2)

Now, condition 1 is formed by two.

<u>FINAL EXPRESSION</u>

(condition 1) OR (condition 2)

((heardNoise equals True AND sawMovement equals True) OR vaultClosed equals True)

<u>REAL CODE</u>

Depending on the programming language you are using, the way to write the expression could vary. If C language is used, the expression would be:

if((heardNoise==1 && sawMovement==1) || vaultClosed==1))

The number 1 refers to the word TRUE

You might be interested in
Identify an advantage of working in teams.
ra1l [238]

If you're on apex and you have the answer choice

A: Less wasted time

B: Less skills

C: Strong work ethics

D: More ideas

Then D is the answer

7 0
3 years ago
In the line of code shape ("classic") which part of the code is the argument
Mekhanik [1.2K]
Whatever is in the parenthese
5 0
3 years ago
Read 2 more answers
What is the name of small programs stored on the hard drive that tell the computer how to communicate with a specific hardware d
Katena32 [7]
Small programs stored on the harddrive that provide basic functionality for he devices listed would be called Hardware Drivers.
I hope this helps!
5 0
3 years ago
(01.01 LC)
zloy xaker [14]

Answer:

Create web and mobile applacations

Explanation:

6 0
2 years ago
Anyone here have Tik Tok?I'm just curious. :) my acc is alexlpark1fanaccount btw thanks!
kiruha [24]
Haircut is my name on tictok
8 0
3 years ago
Other questions:
  • In excel what does sidney need to consider when creating formulas
    7·1 answer
  • Gap junctions and plasmodesmata have what feature in common?
    6·1 answer
  • A media strategy that involves high ________ most likely involve creating broad exposure using many media vehicles, while a stra
    15·1 answer
  • What is the difference between player-centric game design and designer-centric game design? How does a player-centric game assis
    7·1 answer
  • Hey system has defined specific Quetion that describe how signals are sent over connections. Which layer of the transmission con
    11·1 answer
  • Hey should I get a r()blox gift card if so what amount 5 dollars 10 or 100
    14·1 answer
  • There is a feature that allows you to lock the document, to avoid others making changes. True or False
    6·1 answer
  • Brainliest
    13·2 answers
  • What does Stand for in web design
    9·1 answer
  • What are two potential benefits of using calendar-synchronization tools like calendly
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!