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

A ) Suppose you have a class called base which has been inherited by a class cal

ID: 643315 • Letter: A

Question

A) Suppose you have a class called base which has been inherited by a class called derived.

    ( both classes have public, protected and private members )

    What can a client of derived access within the class base ?

    What can the class derived access within the class base ?

B) Suppose you have a class called more which has a private object of a class called simple. ( both classes have public, protected and private members )

    What can a client of more access within the class simple ?

    What can the class more access within the class simple ?

C )Suppose you have an int pointer which contains the address of a dynamic variable.

    What will you be able to

Explanation / Answer

A)

What can a client of derived access within the class base ?

only the public members of base class

What can the class derived access within the class base ?

both public and private members of base class

B)

What can a client of more access within the class simple ?

only the public members of simple class

What can the class more access within the class simple ?

only the public members of simple class

C)

if you have a address of a dynamic variable and

if you pass that variable into function by value ?

then you can modify the value pointed by the address stored in this variable

if you pass that variable into function by reference ?

then you can modify the value pointed by the address stored in this variable and also the address of the variable