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
Computer crimes are a big concern since the creation of innovative technological advances; which is/are examples of computer cri
Natali [406]

Answer:

The answer is E: All of the above

Explanation:

All of the above scenarios are examples of serious computer crimes. They are crimes that exist in the offline world but take place online. Sexual predators, for instance, mostly take advantage of the anonymity provided by the internet. They often target dating sites and find suitable victims. Cyber bullying and Cyber stalking are just as harmful as any other computer crime. Industrial Espionage may also somehow fall into this category. Less frequently, criminals may steal documents and computer files or more often, illegally gain access to company’s trade secrets on computers and servers.

3 0
2 years ago
Read 2 more answers
Write a program that initializes a string variable and prints the first three characters, followed by three periods, and then th
d1i1m1o1n [39]

firstly we have to initialize the variable, means to give variable a value and then print the statement

string = "fahadisahadam"

print(string[:3]+"..."+string[-3:])

string is a data type that contains two or more characters.

means the string is fahadisahadam so the print will print first three characters. follow by three periods(...) and then last three characters.

The output will be:

fah...dam

8 0
3 years ago
What is a text feature that could add visual interest and clarity to a procedural document?
rjkz [21]

Bullet points is another

3 0
2 years ago
Read 2 more answers
File "f2" has a size of 2. Why? A. It contains the string "f1". B. It contains two blank lines.
Aneli [31]

Answer:

A. It contains the string "f1"

7 0
2 years ago
I'll give you Brainliest if you can tell me the name of this class and the name of the game, LOL
aivan3 [116]

scout tf2 now bow down

7 0
2 years ago
Other questions:
  • When one block is executed after another block in order from top to bottom, this is called ______ (see picture) Question 31 opti
    8·1 answer
  • . Two or more functions may have the same name, as long as their _________ are different.
    9·1 answer
  • write a program that reads in the length and the width of a rectangular yard . your program should compute the time required ( i
    5·1 answer
  • If a person sends email from a school computer or a business computer, should that message be considered private?
    8·2 answers
  • A supplier certification program: Group of answer choices
    9·1 answer
  • You are a database administrator. Chantelle comes to you asking for help on how to access all the data in one row of the databas
    11·1 answer
  • . In the BorderLayout class, what are NORTH, SOUTH, EAST, WEST, and CENTER?
    15·1 answer
  • Will give brainly if answer all or my questions
    8·1 answer
  • Drag each statement to the correct location.
    10·1 answer
  • You're making great progress on your assignment. You've defined the purpose of your message, identified both the primary and sec
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!