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
If you want a user to enter exactly 20 values, which loop would be the best to use?
(Multiple Choice)
4.8/5
(34)
To write read data from a file, you define an object of the __________ data type.
(Multiple Choice)
4.8/5
(39)
A while loop is somewhat limited because the counter can only be incremented by one each time through the loop.
(True/False)
4.8/5
(32)
Something within a while loop must eventually cause the condition to become False or a(n) __________ results.
(Multiple Choice)
4.8/5
(32)
You may define a __________ in the initialization expression of a for loop.
(Multiple Choice)
4.8/5
(34)
Assuming dataFile is a file stream object, the following statement:
DataFile.close();
(Multiple Choice)
4.8/5
(36)
What will the following code display?
Int number = 6;
Cout << number++ << endl;
(Multiple Choice)
4.8/5
(35)
The increment and decrement operators can be used in mathematical expressions; however, they cannot be used in relational expressions.
(True/False)
4.7/5
(33)
In C++ 11 you can pass a string object as an argument to a file stream object's open member function.
(True/False)
4.8/5
(35)
The scope of a variable declared in a for loop's initialization expression always extends beyond the body of the loop.
(True/False)
4.8/5
(42)
What will the following code display?
Int number = 6;
Cout << ++number << endl;
(Multiple Choice)
4.9/5
(41)
What will the following code display?
int number = 6;
++number;
cout << number << endl;
(Multiple Choice)
4.7/5
(27)
This is a control structure that causes a statement or group of statements to repeat.
(Multiple Choice)
4.8/5
(39)
The statements in the body of a while loop may never be executed while the statements in the body of a do-while loop will be executed
(Multiple Choice)
4.8/5
(31)
The condition that is tested by a while loop must be enclosed in parentheses and terminated with a semicolon.
(True/False)
4.8/5
(32)
How many times will the following loop display "Looping!"?
For (int i = 20; i > 0; i--)
Cout << "Looping!" << endl;
(Multiple Choice)
4.7/5
(45)
In the following statement, which operator is used first?
While (x++ < 10)
(Multiple Choice)
4.9/5
(34)
A for statement contains three expressions:
Initialization, test, and
(Multiple Choice)
4.9/5
(33)
Showing 41 - 60 of 60
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)