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

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

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

(Multiple Choice)
4.9/5
(43)

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

(Multiple Choice)
4.8/5
(42)

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

(True/False)
4.8/5
(51)

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

Given the following code which of the following statements is needed to access printResult? Given the following code which of the following statements is needed to access printResult?

(Multiple Choice)
4.8/5
(37)

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

(Multiple Choice)
4.9/5
(44)

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

(Multiple Choice)
4.8/5
(38)

The following is a valid C++ enumeration type: enum places {1ST, 2ND, 3RD, 4TH};.

(True/False)
4.9/5
(31)

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

(Multiple Choice)
4.9/5
(40)

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

(Multiple Choice)
5.0/5
(36)

The following is a legal C++ enumeration type: enum colorType {BLUE, GREEN, PINK, YELLOW, RED};

(True/False)
4.8/5
(38)

No arithmetic operations are allowed on the enumeration type.

(True/False)
4.9/5
(41)

In C++, ____ is a reserved word.

(Multiple Choice)
4.9/5
(34)

Consider the following statements: string str1 = "Gone with the wind"; String str2; After the statement str2 = str1.substr(5,4); executes, the value of str2 is "____".

(Multiple Choice)
4.9/5
(42)

Which of the following statements declares the studentGrade variable?

(Multiple Choice)
4.7/5
(32)

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

The string expression strVar.____________________ starts at index pos, replaces the next n characters of strVar with all the characters of str.

(Short Answer)
4.8/5
(36)

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

(Short Answer)
4.8/5
(37)

Suppose that str1, str2, and str3 are string variables. After the following statements execute, the value of str3 is "____". Suppose that str1, str2, and str3 are string variables. After the following statements execute, the value of str3 is ____.

(Multiple Choice)
4.9/5
(33)

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
(39)
Showing 21 - 40 of 40
close modal

Filters

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