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
What appears in the document after you have inserted a video?
Nitella [24]

Answer:

text with a hyperlink to the video website

Explanation:

documents do not auto-upload thumbnails or embedded videos for playback, so external links are pasted there

6 0
3 years ago
Read 2 more answers
The ____ line for any e-mail messages you write should clearly state the intention of the e-mail..
KatRina [158]

The <u>subject </u>line for any e-mail messages you write should clearly state the intention of the e-mail.

Electronic mail (e-mail) is a method of digital communications in which messages are exchanged through the internet. The messages are sent from a sender to one or more receivers.  Depending on user’s perspective, every user uses e-mail differently.  Communicating via e-mail requires e-mail platforms such as G*mail, Ya*hoo! Mail, Hot*mail, and Out*look etc. In the every e-mail, there is a subject line that clearly state the intention of the e-mail.

Subject line is an important element of an e-mail. Through the subject line, the message written in the e-mail is briefly summarized in six to eight words. A clearly written subject line provides the recipient a clear understanding that why the email has been sent. When recipient replies back to the e-mail, the subject line is changed accordingly.

This is the subject line of the e-mail that convince the receiver whether to open and read the e-mail. So, it should be written in the way that gives clear intention of the e-mail. We can say that the subject line of the e-mail is the most significant few words in the whole e-mail to convey the main purpose of the e-mail.

You can learn more about subject line at

brainly.com/question/14572730

#SPJ4

3 0
2 years ago
To use
sasho [114]

Answer:

Sticky notes

Explanation:

I got the question correct

7 0
3 years ago
Write a program that uses the function isPalindrome given in Example 6-6 (Palindrome). Test your program on the following string
Artist 52 [7]

Answer:

#include <bits/stdc++.h>

using namespace std;

bool isPalindrome(string str)

{

   char a,b;

int length = str.length();

for (int i = 0; i < length / 2; i++)

{

   a=tolower(str[i]);//Converting both first characters to lowercase..

   b=tolower(str[length-1-i]);

   if (b != a )

return false;

}

return true;

   

}

int main() {

   string t1;

   cin>>t1;

   if(isPalindrome(t1))

   cout<<"The string is Palindrome"<<endl;

   else

   cout<<"The string is not Palindrome"<<endl;

return 0;

}

Output:-

Enter the string

madam

The string is Palindrome

Enter the string

abba

The string is Palindrome

Enter the string

22

The string is Palindrome

Enter the string

67876

The string is Palindrome

Enter the string

444244

The string is not Palindrome

Explanation:

To ignore the cases of uppercase and lower case i have converted every character to lowercase then checking each character.You can convert to uppercase also that will also work.

6 0
3 years ago
Hi good morning
Natali5045456 [20]

Answer:

1. SSH/Telnet.

2. SMTP.

3. DNS.

4. DHCP.

5. HTTPS/SSL.

6. FTP

Explanation:

1. Provides connections to computers over a TCP/IP network: the standard protocol used for this is SSH/Telnet, through port number 22 and 23 respectively.

SSH is acronym for secure shell.

2. Sends e-mail over a TCP/IP network: SMTP using port number 25.

SMTP is an acronym for Simple Mail Transfer Protocol and it uses the standard port number of 25 to provide clients with requested services.

3. Translates URLs to IP address: DNS using port number 53.

A Domain Name System (DNS) can be defined as a naming database in which internet domain names (website URLs) are stored and translated into their respective internet protocol (IP) address. This simply means that, DNS is used to connect uniform resource locator (URL) or web address with their internet protocol (IP) address.

4. Automates assignment of IP address on a network: DHCP using port number 67.

Dynamic Host Configuration Protocol (DHCP) is a standard protocol that assigns IP address to users automatically from the DHCP server.

5. Securely transports web pages over a TCP/IP network: HTTPS/SSL using port number 443.

HTTPS is acronym for Hypertext Transfer Protocol Secure while SSL is acronym for Secure Sockets Layer (SSL).

6. Transports files over a TCP/IP network: FTP using port number 20 or 21.

FTP is an acronym for file transfer protocol.

8 0
3 years ago
Read 2 more answers
Other questions:
  • Buildings must be wired to comply with the latest National Electrical Code to ensure that, with adequate maintenance, the instal
    11·1 answer
  • Which of the following cannot be created using Word software?
    15·1 answer
  • Which of the following is true of two-factor authentication?
    13·1 answer
  • A way to minimize technical problems with your computer
    14·1 answer
  • Define and test a function myRange. This function should behave like Python’s standard range function, with the required and opt
    11·2 answers
  • A pointing device controls the movement of the ____.
    15·1 answer
  • "Which NET command is used on a Windows PC to establish a connection to a shared directory on a remote server?"
    11·1 answer
  • I need help with writing the code in Python that draws an arrow pointing to the right.
    15·1 answer
  • In this exercise we will practice using loops to handle collections/containers. Your job is to write a program that asks the use
    6·1 answer
  • Can someone be my friend,don't friend me until i ask you Questions
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!