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
The following is a legal C++ enumeration type:
enum colorType {BLUE, GREEN, PINK, YELLOW, RED};
(True/False)
4.8/5
(40)
The following is a valid C++ enumeration type:
enum places {1ST, 2ND, 3RD, 4TH};.
(True/False)
4.8/5
(28)
The data type string has a named constant, ____________________, associated with it.
(Short Answer)
5.0/5
(41)
Given the following code namespace globalType
{
Void printResult();
}
Which of the following statements is needed to access printResult?
(Multiple Choice)
4.8/5
(37)
In C++, you can create aliases to a previously defined data type by using the ____ statement.
(Multiple Choice)
4.8/5
(35)
The string expression strVar.____________________ inserts all the characters of str at index pos into strVar.
(Short Answer)
4.8/5
(39)
The string expression strVar.____________________ returns the index of the first occurrence at or after pos where str is found in strVar.
(Short Answer)
4.8/5
(39)
Which of the following statements declares the studentGrade variable?
(Multiple Choice)
4.8/5
(45)
The length of the string "Hello There." is ____________________.
(Short Answer)
4.8/5
(43)
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
(38)
Which of the following statements creates an anonymous type?
(Multiple Choice)
4.8/5
(31)
An enumeration type can be passed as a parameter to a function only by value.
(True/False)
4.7/5
(43)
Suppose str = "ABCDEFG". The output of the statement
cout << str.length() << endl;
is ____________________.
(Short Answer)
4.9/5
(43)
The following statement creates an anonymous type:
enum {1ST, 2ND, 3RD, 4TH} places;
(True/False)
4.7/5
(34)
Showing 21 - 40 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)