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

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

Suppose str = "xyzw";. After the statement str[2] = 'Y'; The value of str is "____".

Free
(Multiple Choice)
4.7/5
(35)
Correct Answer:
Verified

C

The general syntax for accessing a namespace member is: namespace_name->identifier.

Free
(True/False)
4.8/5
(36)
Correct Answer:
Verified

False

Suppose str = "ABCDEFGHI". The output of the statement cout << str.length() << endl; Is ____.

Free
(Multiple Choice)
4.8/5
(37)
Correct Answer:
Verified

C

An enumeration type can be passed as a parameter to a function only by value.

(True/False)
4.9/5
(35)

The length of the string "Hello There. " is ____.

(Multiple Choice)
4.7/5
(39)

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

(Multiple Choice)
4.7/5
(37)

A function cannot return the value of an enumeration type.

(True/False)
4.8/5
(35)

Consider the declaration: ​ Enum sports {BASKETBALL, FOOTBALL, HOCKEY, BASEBALL, SOCCER}; ​ Which of the following statements is true? ​

(Multiple Choice)
4.8/5
(35)

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

(True/False)
4.8/5
(30)

Which of the following statements creates an anonymous type?

(Multiple Choice)
4.8/5
(41)

The data type string has a named constant, ____, associated with it.

(Multiple Choice)
4.9/5
(32)

What is the output of the following code? What is the output of the following code?

(Multiple Choice)
4.8/5
(33)

Consider the following statements: After the statement str2 = str1.substr(1,4); executes, the value of str2 is "____". Consider the following statements: After the statement str2 = str1.substr(1,4); executes, the value of str2 is ____.

(Multiple Choice)
4.8/5
(35)

In C++, namespace is a reserved word.

(True/False)
4.8/5
(35)

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
(37)

An anonymous type can be passed as a parameter to a function.

(True/False)
4.8/5
(37)

Which of the following is a valid C++ statement?

(Multiple Choice)
4.8/5
(39)

The values in the domain of an enumeration type are called ____________________.

(Short Answer)
4.8/5
(36)

In ANSI/ISO Standard C++, the ____________________ mechanism was designed to solve the problem of overlapping global identifiers.

(Short Answer)
4.8/5
(37)

The identifiers in the system-provided header files such as iostream, cmath, and iomanip are defined in the namespace ____.

(Multiple Choice)
4.9/5
(40)
Showing 1 - 20 of 40
close modal

Filters

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