Which of the following is considered a multiple-alternative if statement? A. if
ID: 3537692 • Letter: W
Question
Which of the following is considered a multiple-alternative if statement?A.
if (x < y)
r = r + 1;
else if (x > y)
r = r - 1;
else
r = 0;
B.
if (x == y)
x = x + 1;
else
y = y + 1;
C.
if (x == y)
cout << y;
if (x == t)
cout << t;
D.
if (x == y)
if (t == m)
r = r + 1;
E. None of the above. 17.In the following program segment, what set of values of x will cause y to be assigned the value 5?
if (x == 3)
y = 4;
y = 5;
A. x = 3
B. x != 3
C. x < 3
D. All values of x. E. No values of x. 18.How can the effect of the following program segment best be described?
if (x > y)
z = x;
if (x == y)
z = 0;
if (x < y)
z = y;
A. The smaller of x and y is stored in z.
B. The larger of x and y is stored in z.
C. The larger of x and y is stored in z, unless x and y are equal, in which case z is assigned 0.
D. The larger of x and y is stored in z, unless x and y are not equal, in which case z is assigned 0. E. None of the above. 19. In the following expression, the ________ operator will be evaluated last. (Think about precedence, left associativity, and level of nesting.)
(x + y) * z > 7 && y == 3 20. An arithmetic operator is normally used with ____________ type operands. Which of the following is considered a multiple-alternative if statement?
if (x < y)
r = r + 1;
else if (x > y)
r = r - 1;
else
r = 0;
if (x == y)
x = x + 1;
else
y = y + 1;
if (x == y)
cout << y;
if (x == t)
cout << t;
if (x == y)
if (t == m)
r = r + 1;
None of the above. 17.In the following program segment, what set of values of x will cause y to be assigned the value 5?
if (x == 3)
y = 4;
y = 5;
A. x = 3
B. x != 3
C. x < 3
D. All values of x. E. No values of x. 18.How can the effect of the following program segment best be described?
if (x > y)
z = x;
if (x == y)
z = 0;
if (x < y)
z = y;
A. The smaller of x and y is stored in z.
B. The larger of x and y is stored in z.
C. The larger of x and y is stored in z, unless x and y are equal, in which case z is assigned 0.
D. The larger of x and y is stored in z, unless x and y are not equal, in which case z is assigned 0. E. None of the above. 19. In the following expression, the ________ operator will be evaluated last. (Think about precedence, left associativity, and level of nesting.)
(x + y) * z > 7 && y == 3 20. An arithmetic operator is normally used with ____________ type operands. x = 3
x != 3
x < 3
All values of x. No values of x. 18.How can the effect of the following program segment best be described?
if (x > y)
z = x;
if (x == y)
z = 0;
if (x < y)
z = y;
A. The smaller of x and y is stored in z.
B. The larger of x and y is stored in z.
C. The larger of x and y is stored in z, unless x and y are equal, in which case z is assigned 0.
D. The larger of x and y is stored in z, unless x and y are not equal, in which case z is assigned 0. E. None of the above. 19. In the following expression, the ________ operator will be evaluated last. (Think about precedence, left associativity, and level of nesting.)
(x + y) * z > 7 && y == 3 20. An arithmetic operator is normally used with ____________ type operands. 18.How can the effect of the following program segment best be described?
if (x > y)
z = x;
if (x == y)
z = 0;
if (x < y)
z = y;
A. The smaller of x and y is stored in z.
B. The larger of x and y is stored in z.
C. The larger of x and y is stored in z, unless x and y are equal, in which case z is assigned 0.
D. The larger of x and y is stored in z, unless x and y are not equal, in which case z is assigned 0. E. None of the above. 19. In the following expression, the ________ operator will be evaluated last. (Think about precedence, left associativity, and level of nesting.)
(x + y) * z > 7 && y == 3 20. An arithmetic operator is normally used with ____________ type operands. The smaller of x and y is stored in z.
The larger of x and y is stored in z.
The larger of x and y is stored in z, unless x and y are equal, in which case z is assigned 0.
The larger of x and y is stored in z, unless x and y are not equal, in which case z is assigned 0. None of the above. 19. In the following expression, the ________ operator will be evaluated last. (Think about precedence, left associativity, and level of nesting.)
(x + y) * z > 7 && y == 3 20. An arithmetic operator is normally used with ____________ type operands. 19. In the following expression, the ________ operator will be evaluated last. (Think about precedence, left associativity, and level of nesting.)
(x + y) * z > 7 && y == 3 20. An arithmetic operator is normally used with ____________ type operands. A.
if (x < y)
r = r + 1;
else if (x > y)
r = r - 1;
else
r = 0;
B.
if (x == y)
x = x + 1;
else
y = y + 1;
C.
if (x == y)
cout << y;
if (x == t)
cout << t;
D.
if (x == y)
if (t == m)
r = r + 1;
E. None of the above. 17.In the following program segment, what set of values of x will cause y to be assigned the value 5?
if (x == 3)
y = 4;
y = 5;
A. x = 3
B. x != 3
C. x < 3
D. All values of x. E. No values of x. 18.How can the effect of the following program segment best be described?
if (x > y)
z = x;
if (x == y)
z = 0;
if (x < y)
z = y;
A. The smaller of x and y is stored in z.
B. The larger of x and y is stored in z.
C. The larger of x and y is stored in z, unless x and y are equal, in which case z is assigned 0.
D. The larger of x and y is stored in z, unless x and y are not equal, in which case z is assigned 0. E. None of the above. 19. In the following expression, the ________ operator will be evaluated last. (Think about precedence, left associativity, and level of nesting.)
(x + y) * z > 7 && y == 3 20. An arithmetic operator is normally used with ____________ type operands.
Explanation / Answer
Ans:16
Option A.
Ans:17
Option B
Ans:18
Option A
Ans:19
+ operator inside parenthesis
Ans:20
two
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.