Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please help with these 3 questions: Determining when only 2 out of 3 boolean var

ID: 3919785 • Letter: P

Question

Please help with these 3 questions:

Determining when only 2 out of 3 boolean variables are true Assume that the program has declared and initialized three boolean variables named a, b, and c. Write a boolean expression to determine whether all variables except variable a are true. Store the result of this expression in a boolean variable called result. E.g. 1: if a-true, b-true, and c-true, the value of result will be false E.g. 2: if a-false, b-true, and c-true, the value of result will be true. 1 V/ TODO: Write your code here 2 boolean result; Submit

Explanation / Answer

1)

boolean result;

result=(!a && b && c)

2)

i=0;

a={1,2,3,4,5,6,7,8,9,10}

for (i=0;i<n;i++)

a[i]=a[i]+5;

3)

i=1;j=1;

for (i=1;i<=n;i++)//n is number of lines

for (j=1;j<=i;j++)

print("*")

print(" ")