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

QUESTION 2 What is the output for total after the following segment of code exec

ID: 3741476 • Letter: Q

Question

QUESTION 2

What is the output for total after the following segment of code executes? int num = 3, total = 0; switch (num) { case 1: case 2: total = 5; break; case 3: total = 10; break; case 4: total = total + 3; break; case 8: total = total + 6; break; default: total = total + 4; break; } WriteLine("The value of total is " + total); The value displayed for total would be . If num had been initialized to 100, would be displayed. If num was initialized to 1, would be displayed.

QUESTION 3

Assuming the following declarations: int a is 5, b is 6, c is 8; which of the result of each of the expressions. Identify the result of each of the expressions. a. a == 5;_________________ b. 7 <= (a + 2); ___________ c. c <= 4;____________ d. (1 + a) != b; ____________ e. a >= 0; ___________ f. a <= (b * 2); ____________

Explanation / Answer

Question 2

Answer:

When num value is 3 then total is

When num value is 100 then total is

When num value is 1 then total is

The value of total is 5

Question 3

Answer:

a. a == 5;_____true____________

b. 7 <= (a + 2); __true_________

c. c <= 4;______false_____

d. (1 + a) != b; ____false________

e. a >= 0; ___true________

f. a <= (b * 2); ___true_________