Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. The class D inherits from base class B using public inheritance. The class B

ID: 3547200 • Letter: 1

Question

1. The class D inherits from base class B using public inheritance. The class B

has public member function f(), but the derived class has no function member with

this signature. The f() is not available to an object of class D.


2. When you use the open member function to tie a file name to a file stream, the file name

is called the external file name, and the program refers to the file by the stream name.


3. A file is automatically closed when a program terminates, so there is never a need to

close a file.


4. There should eventually be a call to the operator delete on a pointer that

points to the memory allocated by each call to new.


5. If an exception is thrown in a function, say, f(), but not handled there, the exception is

propagated to the function that called f().


6. In C++, an exception object can be a user-defined type or any type that is built-into C++

language.


7. An exception is signaled or raised with the keyword catch followed by an exception

object that may be of any C++ type.


8. In type matching to select a catch block, only exact matches work.


9. When an exception is thrown, the function finishes its execution, its value is returned,

then control is transferred to the catch block.


10. The default copy constructor and default operator = provide only shallow copy.


11. An inheritance chain of any desired length is possible.

Explanation / Answer

1.false

2.true

3.false

4.true

5.true

6.true

7.true

8.

9.true

10.true

11.true