Page 71 - C++
P. 71

{
                                                    gets(Cname);
                                                    cin>Pnumber>>No_of_units;
                                                    Calc_Amount( );
                                       }
                                       void Ele_Bill :: Display( )
                                      {
                                                    cout<<Cname<<Pnumber<<No_of_units<<Amount;
                                      }


                             (½ Mark for declaring class header correctly)
                             (½ Mark for declaring data members correctly)
                             (1 Mark for defining Calc_Amount() correctly)
                             (½ Mark for taking inputs of Cname, Pnumber and No_of_units in
                                  Accept())
                             (½ Mark for invoking Calc_Amount() inside Accept())
                             (½ Mark for defining Display() correctly)
                             (½ Mark for correctly closing class declaration with a semicolon ; )
                             NOTE:
                             Marks to be awarded for defining the member functions inside or
                             outside the class

                      (d)    Answer the questions (i) to (iv) based on the following:                      (4)
                             class Faculty
                             {
                                  int FCode;
                             protected:
                                    char FName[20];
                             public:
                                    Faculty();
                                    void Enter();
                                    void Show();
                             };
                             class Programme
                             {
                                    int PID;
                             protected:
                                    char Title[30];
                             public:
                                    Programme();
                                    void Commence();
                                    void View();
                             };
                             class Schedule: public Programme, Faculty
                             {
                                    int DD,MM,YYYY;
                             public:
                                    Schedule();

                                                              7
   66   67   68   69   70   71   72   73   74   75   76