Exam 7: Namespaces, the Class String, and User-Defined Simple Data Types
Exam 1: An Overview of Computers and Programming Languages40 Questions
Exam 2: Basic Elements of C++50 Questions
Exam 3: Inputoutput40 Questions
Exam 4: Control Structures I Selection40 Questions
Exam 5: Control Structures II Repetition40 Questions
Exam 6: User-Defined Function41 Questions
Exam 7: Namespaces, the Class String, and User-Defined Simple Data Types40 Questions
Exam 8: Arrays40 Questions
Exam 9: Records Structs40 Questions
Exam 10: Classes and Data Abstraction43 Questions
Exam 11: Inheritance and Composition41 Questions
Exam 12: Pointers, Classes, Virtual Functions, and Abstract Classes43 Questions
Exam 13: Overloading and Templates41 Questions
Exam 14: Exception Handling42 Questions
Exam 15: Recursion41 Questions
Exam 16: Searching and Sorting46 Questions
Exam 17: Linked Lists41 Questions
Exam 18: Stacks and Queues42 Questions
Select questions type
Before using the data type string, the program must include the header file ____.
(Multiple Choice)
4.9/5
(43)
Which of the following statements is used to simplify the accessing of all globalType namespace members?
(Multiple Choice)
4.8/5
(42)
The following statement creates an anonymous type:
enum {1ST, 2ND, 3RD, 4TH} places;
(True/False)
4.8/5
(51)
If a global identifier in a program has the same name as one of the global identifiers in the header file, the compiler generates a(n) ____________________ error.
(Short Answer)
4.9/5
(37)
Given the following code which of the following statements is needed to access printResult?


(Multiple Choice)
4.8/5
(37)
The ____ function is used to interchange the contents of two string variables.
(Multiple Choice)
4.9/5
(44)
The following is a valid C++ enumeration type:
enum places {1ST, 2ND, 3RD, 4TH};.
(True/False)
4.9/5
(31)
In C++, you can create aliases to a previously defined data type by using the ____ statement.
(Multiple Choice)
4.9/5
(40)
Consider the following statements: After the statement position = str.find('D'); executes, the value of position is ____.


(Multiple Choice)
5.0/5
(36)
The following is a legal C++ enumeration type:
enum colorType {BLUE, GREEN, PINK, YELLOW, RED};
(True/False)
4.8/5
(38)
Consider the following statements: string str1 = "Gone with the wind";
String str2;
After the statement str2 = str1.substr(5,4); executes, the value of str2 is "____".
(Multiple Choice)
4.9/5
(42)
Which of the following statements declares the studentGrade variable?
(Multiple Choice)
4.7/5
(32)
Suppose that you have the following declaration. enum cars {FORD, GM, TOYOTA, HONDA};
Cars domesticCars = FORD;
The statement:
DomesticCars = static_cast<cars>(domesticCars + 1);
Sets the value of domesticCars to ____.
(Multiple Choice)
5.0/5
(43)
The string expression strVar.____________________ starts at index pos, replaces the next n characters of strVar with all the characters of str.
(Short Answer)
4.8/5
(36)
The string expression strVar.____________________ inserts all the characters of str at index pos into strVar.
(Short Answer)
4.8/5
(37)
Suppose that str1, str2, and str3 are string variables. After the following statements execute, the value of str3 is "____". 

(Multiple Choice)
4.9/5
(33)
Considering the statement string str = "Gone with the wind";, the output of the statement cout << str.find("the") << endl; is ____.
(Multiple Choice)
4.9/5
(39)
Showing 21 - 40 of 40
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)