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

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

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

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

D

Suppose str = "abcd".After the statement str = str + "ABCD"; the value of str is "____________________".

Free
(Short Answer)
4.8/5
(30)
Correct Answer:
Verified

abcdABCD

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

Free
(Short Answer)
4.9/5
(31)
Correct Answer:
Verified

12

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

(Multiple Choice)
4.8/5
(34)

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

(True/False)
4.7/5
(41)

Before using the data type string,the program must include the header file ____.

(Multiple Choice)
4.8/5
(31)

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

(Short Answer)
4.7/5
(38)

In C++,____ is called the scope resolution operator.

(Multiple Choice)
4.8/5
(35)

In C++,you can create aliases to a previously defined data type by using the ____ statement.

(Multiple Choice)
4.8/5
(32)

The ____ function is used to interchange the contents of two string variables.

(Multiple Choice)
4.7/5
(44)

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

(Multiple Choice)
4.8/5
(33)

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

(Short Answer)
4.9/5
(42)

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

(Multiple Choice)
5.0/5
(35)

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

(Multiple Choice)
4.8/5
(38)

The string expression strVar.____________________ returns the index of the first occurrence at or after pos where str is found in strVar.

(Short Answer)
4.9/5
(39)

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.8/5
(34)

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

The string expression strVar.____________________ deletes n characters from strVar starting at position pos.

(Short Answer)
4.9/5
(47)

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

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

(True/False)
4.8/5
(37)
Showing 1 - 20 of 50
close modal

Filters

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