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 C50 Questions
Exam 3: Inputoutput50 Questions
Exam 4: Control Structures I Selection50 Questions
Exam 5: Control Structures II Repetition50 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 Structs50 Questions
Exam 10: Classes and Data Abstraction49 Questions
Exam 11: Inheritance and Composition50 Questions
Exam 12: Pointers, Classes, Virtual Functions, and Abstract Classes50 Questions
Exam 13: Overloading and Templates50 Questions
Exam 14: Exception Handling50 Questions
Exam 15: Recursion50 Questions
Exam 16: Searching, Sorting and the Vector Type50 Questions
Exam 17: Linked Lists50 Questions
Exam 18: Stacks and Queues50 Questions
Select questions type
Before using the data type string, the program must include the header file ____.
Free
(Multiple Choice)
4.7/5
(38)
Correct Answer:
C
In ANSI/ISO Standard C++, the ____________________ mechanism was designed to solve the problem of overlapping global identifiers.
Free
(Short Answer)
4.8/5
(37)
Correct Answer:
namespace
The length of the string "Hello There. " is ____.
Free
(Multiple Choice)
4.7/5
(37)
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
(43)
Suppose str = "abcd"; After the statement str[1] = 'A'; The value of str is "____________________".
(Short Answer)
4.8/5
(40)
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.7/5
(37)
Consider the declaration: enum sports {BASKETBALL, FOOTBALL, HOCKEY, BASEBALL, SOCCER};
Which of the following statements is true?
(Multiple Choice)
4.9/5
(30)
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
(35)
The general syntax for accessing a namespace member is: namespace_name->identifier.
(True/False)
4.8/5
(44)
The data type string has a named constant, ____, associated with it.
(Multiple Choice)
4.8/5
(46)
The values in the domain of an enumeration type are called ____________________.
(Short Answer)
4.9/5
(46)
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.9/5
(40)
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
(34)
Suppose that str1, str2, and str3 are string variables. After the following statements execute, the value of str3 is "____". str1 = "abc";
Str2 = "xyz";
Str3 = str1 + '-' + str2;
(Multiple Choice)
4.8/5
(34)
The ____ function is used to interchange the contents of two string variables.
(Multiple Choice)
4.8/5
(38)
Which of the following statements is used to simplify the accessing of all globalType namespace members?
(Multiple Choice)
4.9/5
(41)
Suppose str = "abcd". After the statement str = str + "ABCD"; the value of str is "____________________".
(Short Answer)
4.9/5
(37)
In July ____, ANSI/ISO Standard C++ was officially approved.
(Multiple Choice)
4.9/5
(33)
The string expression strVar.____________________ deletes n characters from strVar starting at position pos.
(Short Answer)
4.8/5
(31)
Showing 1 - 20 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)