Page 157 - C++
P. 157

{

               float Total, Agg;

               public:

                       char FinalGrade, comments[20];

               Result();

               void Rcalculate();

               void Rdisplay();

        };

        (i) Which type of inheritance is shown in the above example?

        (ii) Write the names of those data members, which can be directly accessed from the objects of class Result.

        (iii) Write the names of those member functions which can be directly accessed from the objects of class
        Result.


        (iv) Write names of those data members, which can be directly accessed from the Mentry() function of class
        Marks.
                                                             OR


        (d) Consider the following class Trainer:                                                            (4)
        class Trainer

        {

                char TNo[5],Tname[20],specialization[10];

               int Days;

               protected :

                       float Remuneration;

                       void AssignRem(float);

               public:

                       Trainer();

                       void TEntry();

                       void TDisplay();

        };

        Write a code in C++ to publically derive another class Institute with the following additional public members.

        Data Members

        Icode string data type
   152   153   154   155   156   157   158   159   160   161   162