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
To change the space already allocated for a vector,one uses the ______________ member function.
(Short Answer)
4.8/5
(29)
What is the proper way to declare a vector of strings named names?
(Multiple Choice)
4.8/5
(41)
If you want to read into a c-string,you must ensure that the user does not enter more characters than
(Multiple Choice)
4.9/5
(37)
What is the value of numbers.capacity)after the following code?
Vector<float> numbers;
Numbers.reserve100)
(Multiple Choice)
4.9/5
(36)
If vector v has fewer than 24 elements and you call v.resize24)the newly allocated elements are not initialized.
(True/False)
4.9/5
(29)
The following declares a c-string variable that will hold 10 letters.
char str[10];
(True/False)
4.8/5
(33)
Using the == operator on a string variable results in the same value as using strcmp on two c-strings.
(True/False)
5.0/5
(35)
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.8/5
(42)
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.9/5
(36)
Given the following declarations,which of the following is legal syntax?
String str="Your name";
Char c_string[20]="My name";
(Multiple Choice)
4.8/5
(45)
Which string function returns the first occurrence of str1 in a string named str?
(Short Answer)
4.7/5
(34)
What is the value of numbers.size)after the following code?
Vector<float> numbers100);
(Multiple Choice)
4.8/5
(29)
The following code declares a vector of integers named numbers that reserves space for 100 integers.
vector<int> numbers100);
(True/False)
4.8/5
(41)
What is the value of numbers.size)after the following code?
Vector<float> numbers;
(Multiple Choice)
4.9/5
(32)
____________ can be thought of as an array that can grow and shrink as needed.
(Short Answer)
4.8/5
(42)
The following declares a c-string and initializes it to "speaker"
char str[]="speaker";
(True/False)
4.7/5
(40)
The c-string to number conversion functions are in the _________ library.
(Short Answer)
4.9/5
(36)
Showing 41 - 60 of 63
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)