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]
4 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]4 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 do these ideas connect?
Nesterboy [21]

Answer:they are connecting because they are showing adult good of either men or women

Explanation:

3 0
3 years ago
Pls help is very urgent and I will mark u as brainliest plsssss​
elena-s [515]

Answer:

this is the method of processing wood

5 0
3 years ago
Read 2 more answers
Network firewall entry and exit points are called
LuckyWell [14K]
___the answer is ports
6 0
4 years ago
One way bloggers decide how to present information is by understanding
PSYCHO15rus [73]

I would say strong use of multimedia.

4 0
3 years ago
Read 2 more answers
)1-bit sign, 8-bit exponent, 23-bit fraction and a bias of127 is used for ___________ Binary Floating PointRepresentation
Darina [25.2K]

Answer: Single  precision

Explanation:

A 1-bit sign, 8-bit exponent, 23-bit fraction and a bias of 127 is used for the single precision binary floating point representation. As, single precision is the smallest change that can be represented as floating point representation is called as precision. It is the computer format number, which occupies 32 bits in the computer memory.

The IEEE standard specify a binary 32 as:

Sign bit- 1 bit

Exponent width- 8 bits

Significant and precision- 24 bits (23 stored as explicitly)

7 0
3 years ago
Other questions:
  • Which is the last step in conducting a URL search?
    6·1 answer
  • Which of the following should you do first when planning your career
    11·1 answer
  • What is the difference between a technological problem and a technological opportunity? Explain with an example.
    7·2 answers
  • 9.6 Code Practice<br> Instructions<br> 1<br> Declare a 4x 5 array called N<br><br> Please helppp
    9·1 answer
  • Want to be friends on my switch? here :)! friend code: SW-5635-3847-1397​
    13·2 answers
  • Why is one climate different from another?
    14·1 answer
  • Why do we create user accounts to customize our preferences​
    10·1 answer
  • Magnetic video tape in a plastic casing is a?
    13·1 answer
  • The Backstage view is where you can see information and options pertaining to the user account and settings. How is the Backstag
    14·1 answer
  • The Internet Protocol Suite consists of the Internet Protocol and _____. a. Transmission Control Protocol b. File Transfer Proto
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!