1.

Answer the questions (i) to (iv) based on the following: class FaceToFace{char CenterCode[10];public:void Input( );void Output( );};class Online{char website[50];public:void SiteIn( ); void SiteOut( );};class Training: public FaceToFace, private online{ long Tcode; loat charge;int period;public:void Register( );void show( );};(i) Which type of inheritance is shown in the above example?(ii) Write names of all the member functions accessible from Show( ) function of class Training.(iii) Write name of all the member accessible through an object of class Training.(iv) Is the function Output( ) accessible inside the function SiteOut( )? Justify your answer?

Answer»

(i) Multiple Inheritance

(ii) Register( ) Siteln( ), SiteOut( ), Input( ), Output( )

(iii) Register( ), Show( ), Input( ), Output( ).

(iv) No, function Output( ) is not directly accessible inside the function SiteOut( ), because Output( ) is a member function of class FaceToFace and SiteOut( ) is a member function of class Online, and the classes FaceToFace and Online are two independent classes.



Discussion

No Comment Found

Related InterviewSolutions