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 Classes44 Questions
Exam 13: Operator Overloading and Templates41 Questions
Exam 14: Exception Handling43 Questions
Exam 15: Recursion43 Questions
Exam 16: Linked Lists40 Questions
Exam 17: Stacks and Queue43 Questions
Exam 18: Searching and Sorting Algorithms40 Questions
Exam 19: Binary Trees43 Questions
Exam 20: Graph Algorithms48 Questions
Exam 21: Standard Template Library41 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
(74)
Correct Answer:
D
Suppose str = "ABCDEFGHI".The output of the statement cout << str.length() << endl;
Is ____.
Free
(Multiple Choice)
4.8/5
(84)
Correct Answer:
C
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)
4.9/5
(72)
Which of the following statements creates an anonymous type?
(Multiple Choice)
4.8/5
(82)
Which of the following statements declares the studentGrade variable?
(Multiple Choice)
4.8/5
(84)
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
(78)
Suppose str = "xyzw";.After the statement str[2] = 'Y'; The value of str is "____".
(Multiple Choice)
5.0/5
(86)
The general syntax for accessing a namespace member is: namespace_name->identifier.
(True/False)
4.9/5
(74)
An enumeration type can be passed as a parameter to a function only by value.
(True/False)
4.9/5
(60)
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
(86)
Consider the following statements:string str = "ABCDEFD"; string::size_type position;
After the statement position = str.find('D'); executes, the value of position is ____.
(Multiple Choice)
4.9/5
(77)
The values in the domain of an enumeration type are called ____________________.
(Short Answer)
4.7/5
(74)
The ____ function is used to interchange the contents of two string variables.
(Multiple Choice)
4.7/5
(74)
Before using the data type string, the program must include the header file ____.
(Multiple Choice)
4.9/5
(80)
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
(87)
The following is a legal C++ enumeration type:enum colorType {BLUE, GREEN, PINK, YELLOW, RED};
(True/False)
4.9/5
(76)
The following statement creates an anonymous type:enum {1ST, 2ND, 3RD, 4TH} places;
(True/False)
4.8/5
(84)
Which of the following statements is used to simplify the accessing of all globalType namespace members?
(Multiple Choice)
4.8/5
(67)
The data type string has a named constant, ____, associated with it.
(Multiple Choice)
4.7/5
(80)
Showing 1 - 20 of 40
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)