Page 72 - C++
P. 72

void Start();
                                    void View();
                             };
                             void main()
                             {
                                    Schedule S;           //Statement 1
                                    ___________           //Statement 2
                             }
                                                                OR

                             Consider the following class State :
                                           class State
                                           {
                                           protected :
                                           int  tp;
                                           public :
                                           State( ) { tp=0;}
                                           void  inctp( ) { tp++;};
                                           int  gettp(); { return  tp; }
                                           };
                                    Write a code in C++ to publically derive another class ‘District’
                                    with the following additional members derived in the public
                                    visibility mode.
                                    Data Members :
                                    Dname                string
                                    Distance        float
                                    Population      long  int
                                    Member functions :
                                           DINPUT( ) : To enter Dname, Distance and population
                                           DOUTPUT( ) : To display  the data members on the screen.

                      (i)    Write the names of all the member functions, which are directly accessible
                             by the object S of class Schedule as declared in main() function.

                      Ans.   Start(), Schedule::View(), Commence(), Programme::View()

                             (1 Mark for writing all correct member names )
                             NOTE:
                             ● Ignore the mention of Constructors

                      (ii)   Write the names of all the members, which are directly accessible by the
                             memberfunction Start( ) of class Schedule.

                      Ans.  DD,MM,YYYY, Schedule::View()
                             Title, Commence( ), Programme::View()
                             Fname, Enter(), Show()

                             (1 Mark for writing all correct member names )


                                                              8
   67   68   69   70   71   72   73   74   75   76   77