Exam 3: More Flow of Control

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

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

(True/False)
4.7/5
(42)

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

(Multiple Choice)
4.8/5
(39)

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

(True/False)
4.8/5
(38)

How many times is "Hi" printed to the screen Forint i=0;i<14;i++); Cout <<"Hi\n";

(Multiple Choice)
4.9/5
(44)

Which of the following are equivalent to !x<15 && y>=3))?

(Multiple Choice)
4.7/5
(38)

What is wrong with the following for loop? Forint i=0;i<10;i--) { Cout << "Hello\n"; }

(Multiple Choice)
4.8/5
(37)

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

(Multiple Choice)
4.8/5
(35)

It is illegal to make function calls inside a switch statement.

(True/False)
4.8/5
(40)

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

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

(Multiple Choice)
4.9/5
(38)

If you need to write a do-while loop that will ask the user to enter a number between 2 and 5 inclusive, and will keep asking until the user enters a correct number, what is the loop condition?

(Multiple Choice)
4.9/5
(37)

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

(True/False)
4.8/5
(33)

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

(Short Answer)
4.8/5
(30)

A ____________ expression is an expression that can be thought of as being true or false.

(Short Answer)
4.8/5
(38)

Which of the following boolean expressions tests to see if x is between 2 and 15 including 2 and 15)?

(Multiple Choice)
4.9/5
(39)

Each repetition of a loop body is called ____________.

(Short Answer)
4.8/5
(33)

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

(Multiple Choice)
4.9/5
(35)

A break statement in a switch stops your program.

(True/False)
4.8/5
(42)

A function may return a boolean value.

(True/False)
4.8/5
(42)

If a programming language does not use short-circuit evaluation, what is the output of the following code fragment if the value of myInt is 0? Int other=3, myInt; IfmyInt !=0 && other % myInt !=0) Cout << "other is odd\n"; Else Cout << "other is even\n";

(Multiple Choice)
4.9/5
(39)
Showing 21 - 40 of 45
close modal

Filters

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