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
How could this<br> innovation change society?
Lisa [10]

Answer:

invention such as new tool devices progress and resistance benefits to society inventions selfie lies and provide new way to build move communicate heal learn and play

7 0
2 years ago
Ideally, how often should you back up the data on your computer?
miskamm [114]
Once a month should be fine
8 0
3 years ago
Read 2 more answers
Write an expression whose value is the str that consists of the second through fifth characters of the str associated with s. Wr
Lera25 [3.4K]
>>> s = "012345678"
>>> s
'012345678'
>>> s[ 1 : 6 ]
'12345'



4 0
3 years ago
Read 2 more answers
Which of these type parameters is used for a generic class to returnrand accept any type of object?
Free_Kalibri [48]

Answer:

  • To accept and return any type of object T
4 0
3 years ago
Read 2 more answers
Maia notices that her paragraphs are too close to one another. She wants to increase this space. Which arrangement of steps does
sukhopar [10]

Maia can quickly and easily adjust the spacing that exists before and after her paragraphs. To achieve this, she should select her paragraphs and click the Line and Spacing command in the Paragraph command group. She should be able to click the Add Space Before Paragraph from the drop-down menu. The paragraph spacing should change. In the same drop-down menu, she can also select the Line Spacing Option. This will open the Paragraph dialog box. This option will let her control how much space She wants before and after the paragraph. These two options are placed and indicated down below the Paragraph dialog box.

4 0
2 years ago
Read 2 more answers
Other questions:
  • You are provisioning a server with eight-core 3 GHz CMP that can execute a workload with an overall CPI of 2.0 (assuming that L2
    5·1 answer
  • Question 1 (True/False Worth 15 points)
    6·1 answer
  • When you access the programs and documents on a computer by what way of icons is said to be employing
    6·1 answer
  • Which property is assigned to a file by the operating system?
    13·1 answer
  • Around what time did the Internet come around and how did it all start? Would like to know more of the history of how the intern
    12·1 answer
  • What are the paragraph different formatting paragraph tools?draw its icon and state its function.
    13·1 answer
  • Write a test program that creates two Rectangle objects—one with width 4 and height 40 and the other with width 3.5 and height 3
    5·1 answer
  • What is a common use for append queries?
    14·2 answers
  • Debugging 2.17.3: Debug: The Two Towers Code Hs
    15·1 answer
  • Which symbol should you use for entering a formula in a cell?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!