Exam 5: Loops and Files
Exam 1: Introduction to Computers and Programming44 Questions
Exam 2: Introduction to C++56 Questions
Exam 3: Expressions and Interactivity44 Questions
Exam 4: Making Decisions53 Questions
Exam 5: Loops and Files62 Questions
Exam 6: Functions49 Questions
Exam 7: Arrays53 Questions
Exam 8: Searching and Sorting Arrays20 Questions
Exam 10: Characters, C++-Strings, and More About the String Class42 Questions
Exam 11: Structured Data43 Questions
Exam 11: Structured Data50 Questions
Exam 12: Advanced File Operations38 Questions
Exam 13: Introduction to Classes46 Questions
Exam 14: More About Classes40 Questions
Exam 15: Inheritance, Polymorphism, and Virtual Functions38 Questions
Exam 16: Exceptions, Templates, and the Standard Template Library STL39 Questions
Exam 17: Linked Lists40 Questions
Exam 18: Stacks and Queues46 Questions
Exam 19: Recursion21 Questions
Exam 20: Binary Trees38 Questions
Select questions type
How many times will the following loop display "Hello"?
for (int i = 20; i > 0; i--)
cout << "Hello!" << endl;
(Multiple Choice)
4.9/5
(31)
When the increment operator precedes its operand, as in ++num1, the expression is in this mode.
(Multiple Choice)
4.8/5
(45)
A while loop's body can contain multiple statements, as long as they are enclosed in braces.
(True/False)
4.7/5
(38)
What will the following code display?
int number = 6;
++number;
cout << number << endl;
(Multiple Choice)
5.0/5
(41)
These are operators that add and subtract one from their operands.
(Multiple Choice)
4.9/5
(37)
Something within a while loop must eventually cause the condition to become false, or a(n) __________ results.
(Multiple Choice)
4.8/5
(41)
Look at the following statement. while (x++ < 10)
Which operator is used first?
(Multiple Choice)
4.8/5
(41)
The while loop contains an expression that is tested for a true or false value, and a statement or block that is repeated as long as the expression
(Multiple Choice)
4.7/5
(38)
The condition that is tested by a while loop must be enclosed in parentheses and terminated with a semicolon.
(True/False)
4.9/5
(39)
To allow file access in a program, you must #include this header file.
(Multiple Choice)
4.8/5
(38)
This statement may be used to stop a loop's current iteration and begin the next one.
(Multiple Choice)
4.9/5
(25)
This is a control structure that causes a statement or group of statements to repeat.
(Multiple Choice)
4.9/5
(41)
A file must be ________ before data can be written to or read from it.
(Multiple Choice)
5.0/5
(38)
If you place a semicolon after the test expression in a while loop, it is assumed to be a(n):
(Multiple Choice)
4.7/5
(36)
What is the output of the following code segment? n = 1;
For ( ; n <= 5; )
Cout << n << ' ';
N++;
(Multiple Choice)
4.8/5
(43)
The update expression of a for loop can contain more than one statement,
e.g. counter++, total+= sales.
(True/False)
4.9/5
(38)
The while loop has two important parts: an expression that is tested for a true or false value, and:
(Multiple Choice)
4.8/5
(43)
Showing 21 - 40 of 62
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)