Exam 8: Strings and Vectors
Exam 1: Introduction to Computer and C++ Programming56 Questions
Exam 2: C++ Basics57 Questions
Exam 3: More Flow of Control45 Questions
Exam 4: Procedural Abstraction and Functions That Return a Value53 Questions
Exam 5: Functions for All Sub Tasks54 Questions
Exam 6: Io Streams As an Introduction to Objects and Classes52 Questions
Exam 7: Arrays48 Questions
Exam 8: Strings and Vectors69 Questions
Exam 9: Pointers and Dynamic Arrays39 Questions
Exam 10: Defining Classes61 Questions
Exam 11: Friends, Overloaded Operators, and Arrays in Classes56 Questions
Exam 12: Separate Compilation and Namespaces41 Questions
Exam 13: Pointers and Linked Lists64 Questions
Exam 14: Recursion48 Questions
Exam 15: Inheritance53 Questions
Exam 16: Exception Handling47 Questions
Exam 17: Templates35 Questions
Exam 18: Standard Template Library59 Questions
Select questions type
Using the resize member function alone, you can increase the capacity of an STL vector.
Free
(True/False)
4.8/5
(35)
Correct Answer:
True
If a vector named numbers has 20 elements in it, what is the result of executing the following statement?
Numbers.resize10);
Free
(Multiple Choice)
4.8/5
(40)
Correct Answer:
C
Vectors can have any type as the base type
Free
(True/False)
5.0/5
(37)
Correct Answer:
True
What is the c-string function to determine the number of characters in a c-string?
(Short Answer)
4.9/5
(43)
You can explicitly use the vector member function resize to increase the capacity of a vector.
(True/False)
4.9/5
(42)
Which of the following would correctly read an entire line from an input file stream named fin into a string variable named line.
(Multiple Choice)
4.8/5
(34)
Using the [i] on a string variable does not check for illegal values of i.
(True/False)
4.8/5
(36)
A character array terminated with the null character is most correctly called
(Multiple Choice)
4.8/5
(36)
What is the value of numbers.size) after the following code?
Vector<float> numbers;
(Multiple Choice)
4.8/5
(41)
What is the code to print out the third character in a string variable named str?
(Short Answer)
4.8/5
(41)
How do you call the function to read a whole line of inputup to 80 characters) from the keyboard into a c-string named str?
(Short Answer)
4.9/5
(34)
Which of the following are correct statements about vector member functions studied in this chapter?
(Multiple Choice)
4.7/5
(30)
If v is a vector and i is an int variable, then in the following the value of i can be any nonnegative int value:
v[i] = i;
(True/False)
4.8/5
(44)
To change the space already allocated for a vector, one uses the ______________ member function.
(Short Answer)
4.8/5
(41)
To convert an integer to a variable of type string one can use the C++11 function _____________.
(Short Answer)
4.9/5
(45)
What is the name of the function to convert from a c-string that contains only digits to an integer?
(Short Answer)
4.9/5
(35)
A vector v will automatically increase the allocated size when more than v.size ) elements are inserted with v.push_back newElement).
(True/False)
4.9/5
(37)
What is the value of numbers.size) after the following code?
Vector<float> numbers;
Numbers.reserve100)
(Multiple Choice)
4.8/5
(38)
Showing 1 - 20 of 69
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)