Exam 9: Classes: a Deeper Look; Throwing Exceptions

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

The type of function a client would use to check the balance of a bank account would be:

Free
(Multiple Choice)
4.9/5
(34)
Correct Answer:
Verified

C

Parameterized stream manipulator setfill specifies the fill character that's displayed when an output is displayed in a field wider than the number of characters or digits in the output. The effect of setfill applies:

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

C

A class's functions can throw exceptions, such as __________to indicate invalid data.

Free
(Multiple Choice)
4.9/5
(39)
Correct Answer:
Verified

C

Which of the following statements about friend functions and friend classes is false?

(Multiple Choice)
5.0/5
(27)

Given the class definition: class CreateDestroy { Public: CreateDestroy() {cout << "constructor called, ";} ~CreateDestroy() {cout << "destructor called, ";} }; What will the following program output? Int main() { For (int i = 1; i <= 2; ++i) { CreateDestroy cd; } Return 0; }

(Multiple Choice)
4.7/5
(22)

The assignment operator (=) can be used to:

(Multiple Choice)
4.7/5
(39)

Assume that t is an object of class Test, which has member functions a(), b(), c() and d(). If the functions a(), b() and c() all return references to an object of class Test (using the dereferenced this pointer) and function d() returns void, which of the following statements will not produce a syntax error:

(Multiple Choice)
4.8/5
(24)

Assuming the following constructor is provided for class Time explicit Time(int = 0, int = 0, int = 0); Which of the following is not a valid way to initialize a Time object?

(Multiple Choice)
4.7/5
(29)

Static data members of a certain class:

(Multiple Choice)
4.8/5
(34)

Which of the following is not true of a constructor and destructor of the same class?

(Multiple Choice)
4.8/5
(36)

Inside a function definition for a member function of an object with data member x, which of the following is not equivalent to this->x:

(Multiple Choice)
4.8/5
(39)

Utility functions:

(Multiple Choice)
4.9/5
(37)

A default constructor:

(Multiple Choice)
4.8/5
(34)

Returning references to non-const, private data:

(Multiple Choice)
4.8/5
(37)

Every object of the same class:

(Multiple Choice)
4.8/5
(32)

Which of the following statements will not produce a syntax error?

(Multiple Choice)
4.9/5
(36)

A client changing the values of private data members is:

(Multiple Choice)
4.7/5
(40)

A class-scope variable hidden by a block-scope variable can be accessed by preceding the variable name with the class name followed by:

(Multiple Choice)
4.7/5
(27)

Which of the following is not true of a destructor?

(Multiple Choice)
4.8/5
(33)

Which of the following statements is false?

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

Filters

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