Exam 5: Loops and Files
Exam 1: Introduction to Computers and Programming47 Questions
Exam 2: Introduction to C62 Questions
Exam 3: Expressions and Interactivity45 Questions
Exam 4: Making Decisions51 Questions
Exam 5: Loops and Files60 Questions
Exam 6: Functions49 Questions
Exam 7: Arrays and Vectors56 Questions
Exam 8: Searching and Sorting Arrays30 Questions
Exam 9: Pointers47 Questions
Exam 10: Characters, C-Strings, and More About the String Class47 Questions
Exam 11: Structured Data46 Questions
Exam 12: Advanced File Operations38 Questions
Exam 13: Introduction to Classes54 Questions
Exam 14: More About Classes46 Questions
Exam 15: Inheritance, Polymorphism, and Virtual Functions43 Questions
Exam 16: Exceptions and Templates36 Questions
Exam 17: The Standard Template Library38 Questions
Exam 18: Linked Lists41 Questions
Exam 19: Stacks and Queues47 Questions
Exam 20: Recursion27 Questions
Exam 21: Binary Trees39 Questions
Select questions type
The __________ loop is a good choice when you do not want the loop to iterate if the condition is False in the beginning.
Free
(Multiple Choice)
4.9/5
(41)
Correct Answer:
A
A file must be __________ before data can be written to or read from it.
Free
(Multiple Choice)
4.9/5
(41)
Correct Answer:
A
When the increment operator precedes its operand, as ++num, the expression is in __________ mode.
Free
(Multiple Choice)
4.9/5
(34)
Correct Answer:
B
What will the following code display?
Int number = 6;
Int x = 0;
X = number--;
Cout << x << endl;
(Multiple Choice)
4.9/5
(32)
What will the following code display?
Int x = 0;
While (x < 5)
{
Cout << x << " ";
X++;
}
(Multiple Choice)
4.8/5
(46)
string objects have a member function named c_str that returns the contents of the object formatted as a null-terminated C-string.
(True/False)
4.8/5
(26)
The __________ loop is ideal in situations where you want the loop to iterate at least once.
(Multiple Choice)
4.7/5
(32)
A file __________ is a small holding section of memory that file-bound information is first written to.
(Multiple Choice)
4.8/5
(44)
An initialization expression may be omitted from the for loop if no initialization is required.
(True/False)
4.8/5
(35)
A variable that is regularly incremented or decremented each time a loop iterates is a
(Multiple Choice)
4.9/5
(29)
Multiple relational expressions cannot be placed into the test condition of a for loop.
(True/False)
4.8/5
(35)
How many times will the following loop display "Hello world!"?
For (int i = 0; i < 20; i++)
Cout << "Hello world!" << endl;
(Multiple Choice)
4.7/5
(39)
This operator increments the value of its operand and then uses the value in context.
(Multiple Choice)
4.8/5
(29)
What will the following code display?
Int number = 6;
Int x = 0;
X = --number;
Cout << x << endl;
(Multiple Choice)
4.9/5
(31)
You may not use both break and continue statements within the same set of nested loops.
(True/False)
4.8/5
(38)
The update expression of a for loop can contain more than one statement, for example:
for(i = 5; i <= 10; i++, total+= sales)
(True/False)
4.7/5
(44)
Showing 1 - 20 of 60
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)