Page 206 - C++
P. 206

__________   // Statement 1
                            __________   // Statement 2
                          } // the end of main( ) function here
                   ii) Which function will be executed at the point where “// the end of main( )
                   function here” is written in the above code? What is this function called and
                   executed here is known as?
                                 (1)

                   c)  Define a class seminar with the following descriptions :
                       (4)
                          Private members
                                 •  sid              -     long
                                 •  topic            -     string of 20 characters
                                 •  venue            -     string of 20 characters
                                 •  fee              -     float
                                 •  calcfee( )      -     A member function to calculate fee depending on
                                     the following criteria:--
                                             Venue             fee
                                             Outdoor           5000
                                             Indoor Non-AC  6500
                                             Indoor AC         7500
                      Public members
                          •  A constructor to assign initial values for topic and venue as “EMPTY” and
                              sid and fee with 0.
                          •  A function register( ) to accept values for sid, topic, venue and call
                              calcfee() to calculate fee.
                          •  a function viewseminar( ) to allow user to view the content of all data
                              members.
                          •  A function retvenue( ) which returns the value of venue.
                   d)  Consider the following class declarations and answer the questions (i) to (iv)
                       (4)
                            class cloth
                            {
                                   char category[5];
                                   char description[20];
                              protected :
                                   float price;
                              public :
                                   cloth( );
                                   void entercloth( );
                                   void dispcloth( );
                            };
                            class design : protected cloth
                            {
                                  char design[20];
                              protected :
                                  float cost;
                              public :
                                  int code;
                                  design( );
                                  void enterdesign( );
                                  void dispdesign( );
                            };
                            class costing : public cloth
                            {
                                  float designfee;
                                  float stiching;
                                  float calc_cp( );
                              protected :
                                  float costprice;
                                  float sellprice;
                              public :
   201   202   203   204   205   206   207   208   209   210   211