Suppose that a class employeetype is derived from the class


Suppose that a class employeeType is derived from the class personType. Give examples of data and function members that can be added to the class employeeType.

For example:
myClock yourClock
hr: 2 hr: 14
min: 26 min: 39
sec: 47 sec: 28

Consider the following statements:

class yClass
{
public:
void one();
void two(int, int);
yClass();
private:
int a;
int b;
};

class xClass : public yClass
{
public:
void one();
xClass();
private:
int z;
};

yClass y;
xClass x;

a. The private members of yClass are public members of xClass. True or False?

b. Mark the following statements as valid or invalid. If a statement is invalid, explain why.

(i)
void yClass : :one()
{
cout<}

(ii)
y?a = 15;
x?b = 30;

(iii)
void xClass::one()
{
a = 10;
b = 15;
z = 30;
cout<}

(iv)
cout<

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Suppose that a class employeetype is derived from the class
Reference No:- TGS01247566

Now Priced at $20 (50% Discount)

Recommended (94%)

Rated (4.6/5)