Exam 7: User-Defined Simple Data Types, Namespaces, and the String Type

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

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)

In C++, [] is called the array subscript operator.

(True/False)
4.8/5
(42)

The string expression strVar.____________________ inserts all the characters of str at index pos into strVar.

(Short Answer)
4.8/5
(39)

In C++, namespace is a reserved word.

(True/False)
4.7/5
(42)

In C++, ____ is a reserved word.

(Multiple Choice)
4.8/5
(36)

The scope of a namespace member is local to the ____.

(Multiple Choice)
4.8/5
(28)

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)

A function cannot return the value of an enumeration type.

(True/False)
4.9/5
(36)

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)

No arithmetic operations are allowed on the enumeration type.

(True/False)
4.8/5
(32)

The following statement creates an anonymous type: enum {1ST, 2ND, 3RD, 4TH} places;

(True/False)
4.7/5
(34)
Showing 21 - 40 of 50
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)