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

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

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

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

C

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

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

namespace

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

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

C

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.9/5
(43)

Suppose str = "abcd"; After the statement str[1] = 'A'; The value of str is "____________________".

(Short Answer)
4.8/5
(40)

Consider the following statements: string str = "ABCDEFD"; String::size_type position; After the statement position = str.find('D'); executes, the value of position is ____.

(Multiple Choice)
4.7/5
(37)

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

(Multiple Choice)
4.9/5
(30)

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

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

(True/False)
4.8/5
(44)

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

(Multiple Choice)
4.9/5
(38)

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

(Multiple Choice)
4.8/5
(46)

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

(Short Answer)
4.9/5
(46)

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.9/5
(40)

Considering the statement string str = "Gone with the wind";, the output of the statement cout << str.find("the") << endl; is ____.

(Multiple Choice)
4.9/5
(34)

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

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

(Multiple Choice)
4.8/5
(38)

Which of the following statements is used to simplify the accessing of all globalType namespace members?

(Multiple Choice)
4.9/5
(41)

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

(Short Answer)
4.9/5
(37)

In July ____, ANSI/ISO Standard C++ was officially approved.

(Multiple Choice)
4.9/5
(33)

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

(Short Answer)
4.8/5
(31)
Showing 1 - 20 of 50
close modal

Filters

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