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
Quantas calorias os adolescentes devem consumir diariamente?
Tema [17]

Answer: los niños requieren un promedio de 2.800 calorías por día, las niñas requieren un promedio de 2.200 calorías por día.

Explanation:

6 0
3 years ago
I'm curious why I would need to know this on a school learning site.
zhannawk [14.2K]
no idea either lol, I mean school forces you to learn





..
4 0
3 years ago
Consider the two computers A and B with the clock cycle times 100 ps and 150 ps respectively for some program. The number of cyc
Kipish [7]

Answer:

Option d) B is 1.33 times faster than A

Given:

Clock time, t_{A} = 100 ps

t_{A} = 150 ps

No. of cycles per instructions,  n_{A} = 2.0

n_{B} = 1.0

Solution:

Let I be the no. of instructions for the program.

CPU clock cycle, f_{A} = 2.0 I

CPU clock cycle, f_{B} = 1.0 I

Now,

CPU time for each can be calculated as:

CPU time, T = CPU clock cycle\times clock time

T_{A} = f_{A}\times t_{A} = 2.0 I\times 100 = 200 I ps

T_{B} = f_{B}\times t_{B} = 1.0 I\times 100 = 150 I ps

Thus B is faster than A

Now,

\frac{Performance of A}{Performance of B} = \frac{T_{A}}{T_{B}}

\frac{Performance of A}{Performance of B} = \frac{200}{150}

Performance of B is 1.33 times that of A

7 0
2 years ago
Read 2 more answers
All of the following are ways to save money on transportation except :
Lisa [10]
The options listed are not related to the question. and if they were related in any sense then I would say the cheapest thing on the list is a phone card so I guess you can buy that and save the most for your travel as you can use phone cards anywhere as they have 1800 numbers which are free from any public phone. 
7 0
3 years ago
You can be sentenced to up to 180 days in jail for driving with a license that was suspended for _________ .
Yanka [14]

Answer:c\

Explanation:

4 0
3 years ago
Other questions:
  • Can you combine a wireless and wired lan in the same home
    14·1 answer
  • What should you remember when using the thesaurus to replace words?
    8·2 answers
  • What’s the most popular operating system
    9·2 answers
  • To determine the average of a range of numbers, click the ____ in the formula bar, then click average.
    13·1 answer
  • Jason Has A Science Video Project, As He Creats His Project, He Saves, Then Comes Back A Minute Later. The File Is Now Unreadabl
    8·2 answers
  • Software that was designed to serve the needs of a specific company or organization is called:
    11·1 answer
  • س2) اکتب خوارزميه لحل المعادلة الرياضيه الاتيه
    9·1 answer
  • Why was the Internet first developed? Use details and information to explain your answer.
    6·1 answer
  • Global address list characteristics
    11·1 answer
  • Figure out what this says:<br><br> ?driew tib a kool ti seoD
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!