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
What will the following code display?
Int x = 0;
For (int count = 0; count < 3; count++)
X += count;
Cout << x << endl;
(Multiple Choice)
4.7/5
(37)
If you want to stop a loop before it goes through all of its iterations, the break statement may be used.
(True/False)
5.0/5
(40)
To write data to a file, you define an object of the __________ data type.
(Multiple Choice)
5.0/5
(44)
What is the output of the following code segment?
N = 1;
While (n <= 5)
Cout << n << ' ';
N++;
(Multiple Choice)
4.9/5
(33)
A while loop's body can contain multiple statements, as long as they are enclosed in braces.
(True/False)
4.8/5
(36)
A statement that may be used to stop a loop's current iteration and begin the next one is
(Multiple Choice)
4.8/5
(28)
The __________ loop is a good choice when you know how many times you want the loop to iterate in advance of entering the loop.
(Multiple Choice)
4.9/5
(41)
It is possible to define a file stream object and open a file in one statement.
(True/False)
4.8/5
(32)
Assuming outFile is a file stream object and number is a variable, which statement writes the contents of number to the file associated with outFile?
(Multiple Choice)
4.9/5
(34)
The two important parts of a while loop are the expression that is tested for a true or False value and
(Multiple Choice)
4.8/5
(31)
These are operators that add and subtract one from their operands.
(Multiple Choice)
4.9/5
(36)
A special value that marks the end of a list of values is a
(Multiple Choice)
4.8/5
(31)
To allow file access in a program, you must use __________ in the header file.
(Multiple Choice)
4.8/5
(39)
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
(41)
How many times will the following loop display "Looping again!"?
For (int i = 0; i <= 20; i++)
Cout << "Looping again!" << endl;
(Multiple Choice)
4.8/5
(34)
You may nest while and do-while loops but you may not nest for loops.
(True/False)
4.8/5
(30)
What will the following code display?
int number = 6;
number++;
cout << number << endl;
(Multiple Choice)
4.8/5
(44)
Showing 21 - 40 of 60
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)