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
A(n) _______ is the most basic type of access query
san4es73 [151]
Select Query
I hope this helps! :)
4 0
2 years ago
In this lab, you complete a C++ program that swaps values stored in three int variables and determines maximum and minimum value
Sergio039 [100]

Answer:

Following are the code to the given question:

#include <iostream>//header file

using namespace std;

int main()//main method

{

int first = 0,second = 0,third = 0;//defining integer variable  

int temp; //defining integer variable

const string SENTINEL = "done"; // defining a string variable as constant  

string repeat;// defining a string variable  

bool notDone = true; //defining bool variable

cout << "Enter first number: ";//print message

cin >> first;//input value

cout << "Enter second number: ";//print message

cin >> second;//input value

cout << "Enter third number: ";//print message

cin >> third;//input value

while(notDone == true)//defining a loop to check the value  

{

if(first > second)//use if to compare first and second value

{

int temp = first;//defining temp to hold first value

first = second;//holding second value in first variable

second = temp;//holding temp value in second variable

}

if(second > third)//use if to compare second and third value

{

int temp = second;//defining temp to hold second value

second = third;//holding second value in third variable

third = temp;//holding temp value in third variable

}

cout << "Smallest: " << first << endl;//print smallest value

cout << "Next smallest: " << second << endl;//print Next smallest value

cout << "Largest: " << third << endl;////print Largest value

cout << "Enter any letter to continue or done to quit: ";//print message

cin >> repeat;//holding string value

if (repeat == SENTINEL)

{

notDone = false;//holding bool value

}  

else //else block

{

cout << "Enter first number: ";//print message

cin >> first;//input value

cout << "Enter second number: ";//print message

cin >> second;//input value

cout << "Enter third number: ";//print message

cin >> third;//input value

}

return 0;

}

}

Output:

Please find the attached file.

Explanation:

  • Inside the main method Four integer variable "first, second, third, and temp" is declared in which first three variable is used for input value and temp is used to compare value.
  • In thew next step, two string variable "SENTINEL and repeat" is declared in which "SENTINEL" is constant and a bool variable "notDone" is declared.
  • After input the value from the user-end a loop is declared that compare and swap value and print its value.

6 0
2 years ago
The U.S. continues to become more dependent on the global domain within the information environment consisting of the interdepen
cupoosta [38]

Answer:

cyberspace

Explanation:

It is the notional environment in which communication over computer networks occurs.

5 0
3 years ago
The engine that runs the computer. Small computers have one, while larger computers may
Dmitrij [34]

Answer:

CPU.

Explanation:

A processor, also known as a Central Processing Unit, is a piece of hardware in a computer that performs basic operations and control when executing program code.

Processors are usually made as integrated circuits closed in a hermetic casing, often with gold-plated leads (used for resistance to oxidation) and in this form they are called microprocessors - in common speech the terms processor and microprocessor are used interchangeably. The heart of the processor is a single crystal of silicon, on which a series of semiconductor layers have been applied by means of photolithography, forming, depending on the application, a network of several thousand to several billion transistors. Its circuits are made of metals with good electrical conductivity, such as aluminum and copper.

7 0
2 years ago
1. Conflict resolution is the process of solving disputes and disagreements.
gtnhenbr [62]
1. Conflict resolution is the process of solving disputes and disagreements.

A. True


2. Project managers have the overall responsibility for planning, executing, and completing a project.

A. True


3. Read the following scenario:

A project will require more people than originally estimated.

Identify the possible risks to the project.

B. Money and resources


4 0
3 years ago
Other questions:
  • Sean is white hat hacker, who is demonstrating a network level session hijack attacks and as part of it, he has injected malicio
    6·1 answer
  • When computers connect to one another to share information, but are not dependent on each other to work, they are connected thro
    14·2 answers
  • What does your digital footprint say about you? Does your digital footprint
    15·1 answer
  • HELP FOR JAVASCRIPT: 01. What is prototypical inheritance? 02. How can JavaScript be used to improve accessibility on the web? I
    6·1 answer
  • The hottest part of the Earth is the
    9·2 answers
  • Jack wants to save his PowerPoint file electronically. He should store his file in:
    6·2 answers
  • Write a method doubleUp that doubles the size of a list of integers by doubling-up each element in the list. Assume there's enou
    13·1 answer
  • Which interpersonal skill is the most important for a telecom technician to develop?
    7·1 answer
  • How do i know my child's login info for parent infinite campus
    14·1 answer
  • I will make you brainless Just answer this question!!
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!