Exam 3: More Flow of Control

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

What is the value of the following expression? True && 4/3 || !6)))

Free
(Multiple Choice)
4.7/5
(29)
Correct Answer:
Verified

A

if x is 0, what is the value of !x ==0)?

Free
(Multiple Choice)
4.7/5
(39)
Correct Answer:
Verified

A

Given the following code, what is the final value of i? Int i; Fori=0; i<=4;i++) { Cout << i << endl; }

Free
(Multiple Choice)
4.8/5
(37)
Correct Answer:
Verified

C

What is the value of x after the following code executes? Int x=10; If ++x >10) { X =13; }

(Multiple Choice)
4.9/5
(35)

A loop that iterates one too many or one too few times is said to be ________

(Short Answer)
4.9/5
(39)

A _________ loop always executes the loop body at least once, irregardless of the loop condition.

(Short Answer)
4.7/5
(32)

What is NOT an advantage of an enum class over a standard enum?

(Multiple Choice)
4.7/5
(41)

Which boolean operation is described by the following table? Which boolean operation is described by the following table?

(Multiple Choice)
4.8/5
(33)

Variables defined inside a set of braces are said to be _______ to that block of code.

(Short Answer)
4.9/5
(46)

The break statement causes all loops to exit.

(True/False)
4.7/5
(38)

Given the following enumerated data type definition, what is the value of SAT? Enum myType{SUN,MON,TUE,WED,THUR,FRI,SAT,NumDays};

(Multiple Choice)
4.9/5
(34)

The compiler always pairs an else with _______________

(Essay)
4.8/5
(33)

What is wrong with the following switch statement? Int ans; Cout <<"Type y for yes on n for no\n"; Cin >> ans; Switch ans) { Case 'y': Case 'Y': cout << "You said yes\n"; break; Case 'n': Case 'N': cout << "You said no\n"; break; Default: cout <<"invalid answer\n"; }

(Multiple Choice)
4.7/5
(42)

Which boolean operation is described by the following table? Which boolean operation is described by the following table?

(Multiple Choice)
4.9/5
(36)

Which of the following symbols has the highest precedence?

(Multiple Choice)
4.9/5
(39)

What is the output of the following code fragment if x is 15? Ifx < 20) Ifx <10) Cout << "less than 10 "; Else Cout << "large\n";

(Multiple Choice)
4.9/5
(29)

_________ is a type whose values are defined by a list of constants of type int.

(Short Answer)
4.7/5
(31)

Which of the following is not a good reason for choosing a certain loop control?

(Multiple Choice)
4.9/5
(37)

Which of the following are valid case statements in a switch?

(Multiple Choice)
4.8/5
(41)

A switch statement variable must be ________

(Short Answer)
4.8/5
(39)
Showing 1 - 20 of 45
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)