Exam 3: More Flow of Control

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

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

(Short Answer)
4.7/5
(33)

Which loop structure always executes at least once?

(Multiple Choice)
4.8/5
(42)

The code following the ________ case is executed if none of the other cases are matched in a switch statement.

(Short Answer)
4.9/5
(32)

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

(Multiple Choice)
4.9/5
(32)

In an enumerated data type,different constants may not have the same value.

(True/False)
4.8/5
(28)

All nested if-else statements can be converted into switch statements.

(True/False)
4.9/5
(30)

What is the output of the following code fragment? { Int x=13; Cout << x <<","; } Cout << x << endl;

(Multiple Choice)
4.8/5
(36)

A semicolon by itself is a valid C++ statement.

(True/False)
4.8/5
(45)

A compound statement that contains variable declarations is called a __________.

(Short Answer)
4.9/5
(30)

The compiler always pairs an else with _______________

(Essay)
4.9/5
(41)

Each repetition of a loop body is called ____________.

(Short Answer)
4.9/5
(34)

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.7/5
(30)

If you want a loop to quit iterating if x < 10 and y > 3,what would be the proper loop condition test?

(Multiple Choice)
4.7/5
(40)

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

(Multiple Choice)
4.9/5
(37)

A boolean expression may evaluate to more than 2 values

(True/False)
4.7/5
(37)

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.9/5
(48)

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

(Multiple Choice)
4.8/5
(29)

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

(Short Answer)
4.8/5
(42)

All switch statements can be converted into nested if-else statements

(True/False)
4.8/5
(30)

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.7/5
(40)
Showing 21 - 40 of 44
close modal

Filters

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