Exam 4: Control Structures I (Selection)
Exam 1: An Overview of Computers and Programming Languages50 Questions
Exam 2: Basic Elements of C++50 Questions
Exam 3: Input/Output50 Questions
Exam 4: Control Structures I (Selection)50 Questions
Exam 5: Control Structures II (Repetition)50 Questions
Exam 6: User-Defined Functions50 Questions
Exam 7: User-Defined Simple Data Types, Namespaces, and the string Type50 Questions
Exam 8: Arrays and Strings50 Questions
Exam 9: Records (structs)50 Questions
Exam 10: Classes and Data Abstraction50 Questions
Exam 11: Inheritance and Composition50 Questions
Exam 12: Pointers, Classes, Virtual Functions, Abstract Classes, and Lists50 Questions
Exam 13: Overloading and Templates50 Questions
Exam 14: Exception Handling50 Questions
Exam 15: Recursion50 Questions
Exam 16: Linked Lists50 Questions
Exam 17: Stacks and Queues50 Questions
Exam 18: Searching and Sorting Algorithms50 Questions
Exam 19: Binary Trees50 Questions
Exam 20: Graphs50 Questions
Exam 21: Standard Template Library (STL)50 Questions
Select questions type
Which of the following operators has the highest precedence?
Free
(Multiple Choice)
4.7/5
(42)
Correct Answer:
A
A(n)____________________ structure does not require the evaluation of a logical expression.
Free
(Short Answer)
5.0/5
(36)
Correct Answer:
switch
What is the output of the following code?
if (6 > 8)
{
Cout << " ** " << endl ;
Cout << "****" << endl;
}
else if (9 == 4)
cout << "***" << endl;
else
cout << "*" << endl;
Free
(Multiple Choice)
4.9/5
(36)
Correct Answer:
A
What is the output of the following code? char lastInitial = 'A';
Switch (lastInitial)
{
Case 'A':
Cout << "section 1" << endl;
Break;
Case 'B':
Cout << "section 2" << endl;
Break;
Case 'C':
Cout << "section 3" << endl;
Break;
Case 'D':
Cout << "section 4" << endl;
Break;
Default:
Cout << "section 5" << endl;
}
(Multiple Choice)
4.8/5
(29)
For a program to use the assert function,it must include which of the following?
(Multiple Choice)
4.7/5
(43)
A control structure alters the normal sequential flow of execution in a program.
(True/False)
4.8/5
(36)
The expression (x >= 0 && x <= 100)evaluates to false if either x < 0 or x >= 100.
(True/False)
4.9/5
(39)
What is the output of the following C++ code?
int x = 35;
int y = 45;
int z;
if (x > y)
z = x + y;
else
z = y - x;
Cout << x << " " << y << " " << z << endl;
(Multiple Choice)
4.8/5
(39)
What is the output of the following code fragment if the input value is 4? int num;
Int alpha = 10;
Cin >> num;
Switch (num)
{
Case 3:
Alpha++;
Break;
Case 4:
Case 6:
Alpha = alpha + 3;
Case 8:
Alpha = alpha + 4;
Break;
Default:
Alpha = alpha + 5;
}
Cout << alpha << endl;
(Multiple Choice)
4.8/5
(32)
In a ____ control structure,the computer executes particular statements depending on some condition(s).
(Multiple Choice)
4.9/5
(27)
Which of the following is the "not equal to" relational operator?
(Multiple Choice)
4.8/5
(32)
In C++,the logical operator AND is represented by ____________________.
(Short Answer)
4.9/5
(30)
Once an input stream enters a(n)____________________ state,all subsequent input statements associated with that input stream are ignored,and the computer continues to execute the program,which produces erroneous results.
(Short Answer)
4.8/5
(47)
Suppose x is 5 and y is 7.Choose the value of the following expression: (x != 7)&& (x <= y)
(Multiple Choice)
4.8/5
(35)
To output results correctly,the switch structure must include a(n)____________________ statement after each cout statement,except the last cout statement.
(Short Answer)
4.7/5
(28)
The value of the expression 7 + 8 <= 15 is ____________________.
(True/False)
4.8/5
(37)
Showing 1 - 20 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)