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

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

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

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

In C++,____ is a reserved word.

(Multiple Choice)
4.9/5
(42)

A function cannot return the value of an enumeration type.

(True/False)
4.8/5
(39)

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

(True/False)
4.8/5
(43)

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

For the operator + to work with the string data type,one of the operands of + must be a(n)____________________ variable.

(Short Answer)
4.8/5
(42)

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

(Multiple Choice)
4.7/5
(34)

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

(True/False)
4.8/5
(40)

Which of the following statements creates an anonymous type?

(Multiple Choice)
4.8/5
(36)

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

(True/False)
4.8/5
(37)

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

(Multiple Choice)
4.7/5
(36)

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

(True/False)
4.8/5
(33)

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

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

(Multiple Choice)
4.9/5
(35)

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

(Multiple Choice)
4.8/5
(37)

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

(Short Answer)
4.8/5
(38)

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

(Short Answer)
4.9/5
(36)

What is the output of the following code? enum courses {ALGEBRA,BASIC,PASCAL,PHILOSOPHY,ANALYSIS}; Courses registered; Registered = ALGEBRA; Cout << registered << endl;

(Multiple Choice)
4.8/5
(38)

In C++,namespace is a reserved word.

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

Filters

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