Given the following class specification provide the correct

Given the following class specification, provide the correct print out of the following function calls in the main program. If the function call is not allowed, state \"Not Allowed\" as your answer. class ClassA {protected: int x = 3; public: void methodOne (int i) {cout

Solution

a.methodFive(4) --> Is NOT ALLOWED. Since classA as no method called methodFive.

a.methodSix(4) --> is NOT ALLOWED. Since MehodSix is not their in classA.

b.methodThree(4) --> 12. Since classB in inheriting classA, so classA methods can be used/called in classB also.

b.methodFour(4) --> 1.

 Given the following class specification, provide the correct print out of the following function calls in the main program. If the function call is not allowed

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site