Exam 8: Strings and Vectors
Exam 1: Introduction to Computer and C Programming55 Questions
Exam 2: C++ Basics54 Questions
Exam 3: More Flow of Control44 Questions
Exam 4: Procedural Abstraction and Functions That Return a Value51 Questions
Exam 5: Functions for All Sub Tasks53 Questions
Exam 6: Io Streams As an Introduction to Objects and Classes51 Questions
Exam 7: Arrays34 Questions
Exam 8: Strings and Vectors63 Questions
Exam 9: Pointers and Dynamic Arrays40 Questions
Exam 10: Defining Classes50 Questions
Exam 11: Friends, overloaded Operators, and Arrays in Classes49 Questions
Exam 12: Separate Compilation and Namespaces38 Questions
Exam 13: Pointers and Linked Lists51 Questions
Exam 14: Recursion43 Questions
Exam 15: Inheritance53 Questions
Exam 16: Exception Handling47 Questions
Exam 17: Templates33 Questions
Exam 18: Standard Template Library57 Questions
Select questions type
If the name of a file to open is in the string variable name fileName,which of the following will correctly open the file for output?
(Multiple Choice)
4.9/5
(39)
How can you assign the value "toaster" to a c-string name str of size 10?
(Multiple Choice)
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.7/5
(32)
The declaration of an STL vector doubleVec that can hold values of type double,one writes ______________.
(Short Answer)
4.7/5
(38)
Given the following code,what is the correct statement to insert the string str2 into str1,directly after the 'd'?
String str1="abcdefg";
String str2="ABCDE";
(Multiple Choice)
4.9/5
(35)
If the capacity of a vector named names is 20 and the size of names is 19,which of the following statements are legal?
(Multiple Choice)
4.8/5
(31)
What is the value of numbers.size)after the following code?
Vector<float> numbers;
Numbers.reserve100)
(Multiple Choice)
4.8/5
(35)
You can explicitly use the vector member function resize to increase the capacity of a vector.
(True/False)
4.8/5
(30)
What is wrong with the following attempted c-string declaration and initialization?
Char str1[5]={'a','b','c'};
(Multiple Choice)
4.9/5
(40)
To add an element to a vector of integers named numbers at the next available position in the vector,you would use:
(Multiple Choice)
4.9/5
(43)
Which assignment statements will copy the value " toaster" into a string variable str1)?
(Multiple Choice)
4.9/5
(40)
If a vector named numbers has 20 elements in it,what is the result of executing the following statement?
Numbers.resize10);
(Multiple Choice)
4.8/5
(25)
Showing 21 - 40 of 63
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)