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
ivann1987 [24]
3 years ago
7

Under which of the following conditions will evaluating this boolean expression

Computers and Technology
1 answer:
zzz [600]3 years ago
3 0
1.) 
<span>((i <= n) && (a[i] == 0)) || (((i >= n) && (a[i-1] == 0))) </span>

<span>The expression will be true IF the first part is true, or if the first part is false and the second part is true. This is because || uses "short circuit" evaluation. If the first term is true, then the second term is *never even evaluated*. </span>

<span>For || the expression is true if *either* part is true, and for && the expression is true only if *both* parts are true. </span>

<span>a.) (i <= n) || (i >= n) </span>

<span>This means that either, or both, of these terms is true. This isn't sufficient to make the original term true. </span>

<span>b.) (a[i] == 0) && (a[i-1] == 0) </span>

<span>This means that both of these terms are true. We substitute. </span>

<span>((i <= n) && true) || (((i >= n) && true)) </span>

<span>Remember that && is true only if both parts are true. So if you have x && true, then the truth depends entirely on x. Thus x && true is the same as just x. The above predicate reduces to: </span>

<span>(i <= n) || (i >= n) </span>

<span>This is clearly always true. </span>
You might be interested in
Dogs are great pets for families because they teach children many important life lessons. (2) A dog must be walked and fed at ce
PIT_PIT [208]

The answer is A on edge. A)Just like homework and other activities, helping to take care of a dog teaches a child about responsibility.

4 0
3 years ago
Read 2 more answers
What does txt atm mean? what does txt atm mean
Stolb23 [73]
I think it means text
3 0
3 years ago
The Twitter website has become a de facto first source for many important events in the last decade. Twitter's hashtag feature l
timurjin [86]

Answer:

..........................................?

7 0
3 years ago
Read 2 more answers
a _____ is a recreation of a thumbnail in a desktop publishing software, also known as a "rough". a. proof b. digital draft c. l
Dmitrij [34]
D. It’s a sketch. That is, if you talking about, an art piece.
6 0
3 years ago
You should periodically perform basic computer maintenance on your computer.<br> True<br> False
kotegsom [21]

Answer:

that's true after some period of time it's necessary

8 0
2 years ago
Read 2 more answers
Other questions:
  • A Hierarchy Custom Setting stores a specific URL for each profile in Salesforce. Which statement can a developer use to retrieve
    5·1 answer
  • 14. Which commercial RDBMS product was the first to hit the market and is the biggest?
    15·1 answer
  • What time is it in Ohio?
    12·2 answers
  • Is it necessary that every autonomous system use the same intra-AS routing algorithm? Why or why not?
    10·1 answer
  • A computer record is used to store all the information about one transaction, but several such records must be used to store the
    12·1 answer
  • An IT professional with a customer-service
    13·1 answer
  • On his website, Mario has a video that visitors must click to play. He wants the video to play automatically when the page loads
    9·1 answer
  • Help with this quiz question thank you!
    12·2 answers
  • Describe how serial data access finds data
    9·2 answers
  • Please help me i’ll give you brainlist
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!