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
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
(33)
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.8/5
(28)
The following is a legal C++ enumeration type:
enum colorType {BLUE,GREEN,PINK,YELLOW,RED};
(True/False)
4.8/5
(43)
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
(46)
For the operator + to work with the string data type,one of the operands of + must be a(n)____________________ variable.
(Short Answer)
4.8/5
(42)
The identifiers in the system-provided header files such as iostream,cmath,and iomanip are defined in the namespace ____.
(Multiple Choice)
4.7/5
(34)
The following is a valid C++ enumeration type:
enum places {1ST,2ND,3RD,4TH};.
(True/False)
4.8/5
(40)
Which of the following statements creates an anonymous type?
(Multiple Choice)
4.8/5
(36)
An enumeration type can be passed as a parameter to a function only by value.
(True/False)
4.8/5
(37)
Which of the following statements is used to simplify the accessing of all globalType namespace members?
(Multiple Choice)
4.7/5
(36)
The following statement creates an anonymous type:
enum {1ST,2ND,3RD,4TH} places;
(True/False)
4.8/5
(33)
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.8/5
(25)
In July ____,ANSI/ISO Standard C++ was officially approved.
(Multiple Choice)
4.8/5
(37)
The data type string has a named constant,____________________,associated with it.
(Short Answer)
4.8/5
(38)
The string expression strVar.____________________ starts at index pos,replaces the next n characters of strVar with all the characters of str.
(Short Answer)
4.9/5
(36)
What is the output of the following code? enum courses {ALGEBRA,BASIC,PASCAL,PHILOSOPHY,ANALYSIS};
Courses registered;
Registered = ALGEBRA;
Cout << registered << endl;
(Multiple Choice)
4.8/5
(38)
Showing 21 - 40 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)