Exam 7: User-Defined Simple Data Types, Namespaces, and the string Type
Exam 1: An Overview of Computers and Programming Languages50 Questions
Exam 2: Basic Elements of C++50 Questions
Exam 3: Input/Output50 Questions
Exam 4: Control Structures I (Selection)50 Questions
Exam 5: Control Structures II (Repetition)50 Questions
Exam 6: User-Defined Functions50 Questions
Exam 7: User-Defined Simple Data Types, Namespaces, and the string Type50 Questions
Exam 8: Arrays and Strings50 Questions
Exam 9: Records (structs)50 Questions
Exam 10: Classes and Data Abstraction50 Questions
Exam 11: Inheritance and Composition50 Questions
Exam 12: Pointers, Classes, Virtual Functions, Abstract Classes, and Lists50 Questions
Exam 13: Overloading and Templates50 Questions
Exam 14: Exception Handling50 Questions
Exam 15: Recursion50 Questions
Exam 16: Linked Lists50 Questions
Exam 17: Stacks and Queues50 Questions
Exam 18: Searching and Sorting Algorithms50 Questions
Exam 19: Binary Trees50 Questions
Exam 20: Graphs50 Questions
Exam 21: Standard Template Library (STL)50 Questions
Select questions type
Consider the declaration: enum sports {BASKETBALL,FOOTBALL,HOCKEY,BASEBALL,SOCCER};
Which of the following statements is true?
Free
(Multiple Choice)
4.8/5
(32)
Correct Answer:
D
Suppose str = "abcd".After the statement str = str + "ABCD"; the value of str is "____________________".
Free
(Short Answer)
4.8/5
(30)
Correct Answer:
abcdABCD
The length of the string "Hello There." is ____________________.
Free
(Short Answer)
4.9/5
(31)
Correct Answer:
12
The data type string has a named constant,____,associated with it.
(Multiple Choice)
4.8/5
(34)
The general syntax for accessing a namespace member is: namespace_name->identifier.
(True/False)
4.7/5
(41)
Before using the data type string,the program must include the header file ____.
(Multiple Choice)
4.8/5
(31)
The string expression strVar.____________________ inserts all the characters of str at index pos into strVar.
(Short Answer)
4.7/5
(38)
In C++,you can create aliases to a previously defined data type by using the ____ statement.
(Multiple Choice)
4.8/5
(32)
The ____ function is used to interchange the contents of two string variables.
(Multiple Choice)
4.7/5
(44)
Suppose str = "ABCDEFGHI".The output of the statement cout << str.length()<< endl;
Is ____.
(Multiple Choice)
4.8/5
(33)
In ANSI/ISO Standard C++,the ____________________ mechanism was designed to solve the problem of overlapping global identifiers.
(Short Answer)
4.9/5
(42)
Suppose str = "xyzw";.After the statement str[2] = 'Y'; The value of str is "____".
(Multiple Choice)
5.0/5
(35)
The string expression strVar.____________________ returns the index of the first occurrence at or after pos where str is found in strVar.
(Short Answer)
4.9/5
(39)
Suppose that str1 and str2 are string variables.After the following statements execute,the value of str2 is "____________________".
str1 = "abc";
str2 = str1 + '-';
str2 = str2 + "xyz";
(Short Answer)
4.8/5
(34)
A data type wherein you directly specify values in the variable declaration with no type name is called a(n)____________________type.
(Short Answer)
4.9/5
(29)
The string expression strVar.____________________ deletes n characters from strVar starting at position pos.
(Short Answer)
4.9/5
(47)
Consider the following statements: string str1 = "ABCDEFGHIJKLM";
String str2;
After the statement str2 = str1.substr(1,4); executes,the value of str2 is "____".
(Multiple Choice)
4.8/5
(29)
Showing 1 - 20 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)