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
There is only one way to change line spacing in Word.
kobusy [5.1K]
False Line spacing options

Single    This option accommodates the largest font in that line, plus a small amount of extra space. The amount of extra space varies depending on the font that is used.

1.5 lines    This option is one-and-one-half times that of single line spacing.

Double    This option is twice that of single line spacing.

At least    This option sets the minimum line spacing that is needed to fit the largest font or graphic on the line.

Exactly    This option sets fixed line spacing, expressed in points. For example, if the text is in a 10-point font, you can specify 12 points as the line spacing.

Multiple    This option sets line spacing that can be expressed in numbers greater than 1. For example, setting line spacing to 1.15 will increase the space by 15 percent, and setting line spacing to 3 increases the space by 300 percent (triple spacing).

hope this help
4 0
4 years ago
3.18: Pizza Pi Joe’s Pizza Palace needs a program to calculate the number of slices a pizza of any size can be divided into. The
alina1380 [7]

Answer:

#program in python.

#variables

slice_area=14.125

pi=3.14159

#read diameter

d=int(input("Enter diameter of pizza:"))

#area of pizza

area=pi*(d/2)*(d/2)

#number of slice

no_slice=int(area/slice_area)

#print slice

print("total silce are:",no_slice)

Explanation:

Declare and initialize a variable "slice_area" with 14.125 which is the area of a pizza slice.Initialize a variable "pi" with 3.14159.Then read the diameter of pizza.Find the area of pizza as "area=pi *d/2*d/2".Divide the total area with area of pizza slice.This will be the number of slice.

Output:

Enter diameter of pizza:20                                                                                                

total silce are: 22

6 0
3 years ago
Identify actions to take when establishing a business. Check all of the boxes that apply.
Gekata [30.6K]

Plan for the unexpected

write a solid business plan

Keep lines of communication open

Predict how business is progressing

4 0
3 years ago
Read 2 more answers
How can you use Word in order to edit and print documents ?
AleksandrR [38]

Answer:

in word, you go to the File tab on a document, then click print, or enter the keyboard shortcut: ctrl+p

to edit a downloaded document, open the document, and on the top of the document, click "enable editing"

Explanation:

hope this helps!

4 0
3 years ago
Given an array of integers check if it is possible to partition the array into some number of subsequences of length k each, suc
allochka39001 [22]

Answer:

Explanation:

Using Python as our programming language

code:

def partitionArray(A,k):

flag=0

if not A and k == 1:

return "Yes"

if k > len(A) or len(A)%len(A):

return "No"

flag+=1

cnt = {i:A.count(i) for i in A}

if len(A)//k < max(cnt.values()):

return "No"

flag+=1

if(flag==0):

return "Yes"

k=int(input("k= "))

n=int(input("n= "))

print("A= ")

A=list(map(int,input().split()))[:n]

print(partitionArray(A,k))

Code Screenshot:-

3 0
3 years ago
Other questions:
  • When programming, the word "execute" means which of these?
    13·1 answer
  • a _____ is a recreation of a thumbnail in a desktop publishing software, also known as a "rough". a. proof b. digital draft c. l
    15·1 answer
  • Write an application to pre-sell a limited number of theatre tickets. Each buyer can buy as many as 6 tickets. No more than 178
    5·1 answer
  • Where is a 3D modeler most likely to work?
    6·1 answer
  • Which shape denotes a process to be carried out in a flowchart?
    7·2 answers
  • A network technician has created a network consisting of an external internet connection, a DMZ,
    14·1 answer
  • How is digital footprint created ?
    15·1 answer
  • What is the main difference between a fileserver and network attached storage (NAS)?
    10·1 answer
  • _________________ is the logical operator if either conditions is True, then the whole statement is TRUE.
    7·1 answer
  • The int function can convert floating-point values to integers, and it performs rounding up/down as needed.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!