13. Define a class employee with the following void show(); specifications: }; Private Members: Write the names of data members, which Empno integer are accessible from objects belonging to 20 characters class author. Basic, hra, da float Write the names of all the member Netpay float functions which are accessible from objects Calculate() a function to find basic+hra+da belonging to the branch. with float return type name of all the members which are Public Members: accessible from member functions of class Havedata() function to accept values for author. Empno, Ename, Basic, hra, da and invoke How many bytes will be required by an calculate() to calculate netpay. object belonging to the author. Dispdata() function to display all the data Q.2 Answer the questions (i) to (iv) based on the members on the screen. following: class ORGANISATION Chapter 6 : Inheritance { char Address[20]; Q.1 Answer the questions (i) to (iv) based on the double Budget, Income; following: protected: class publisher void compute(); { char pub[12]; public: double turnover; ORGANISATION(); protected: void get(); void register(); void show(); public: }; publisher(); class WORKAREA: public ORGANISATION void enter(); { void display(); char Address[20]; }; int class branch protected: { char city[20]; double pay; protected: void calculate(); float employees; public: public: WORKAREA(); branch(); void void haveit(); void display(); void giveit(); }; }; class SHOWROOM: private ORGANISATION class author: private branch, public publisher { { int Acode; char Address[20]; char Aname[20]; Area; float Amount; double Sale; public: public: author(); SHOWROOM(); void void enter();
13. Define a class employee with the following specifications: Private Members: Empno integer 20 characters Basic, hra, da float Netpay float Calculate() a function to find basic+hra+da with float return type Public Members: Havedata() function to accept values for Empno, Ename, Basic, hra, da and invoke calculate() to calculate netpay. Dispdata() function to display all the data members on the screen. Chapter 6 : Inheritance Q.1 Answer the questions (i) to (iv) based on the following: class publisher { char pub[12]; double turnover; protected: void register(); public: publisher(); void enter(); void display(); }; class branch { char city[20]; protected: float employees; public: branch(); void haveit(); void giveit(); }; class author: private branch, public publisher { int Acode; char Aname[20]; float Amount; public: author(); void void show(); }; Write the names of data members, which are accessible from objects belonging to class author. Write the names of all the member functions which are accessible from objects belonging to the branch. name of all the members which are accessible from member functions of class author. How many bytes will be required by an object belonging to the author. Q.2 Answer the questions (i) to (iv) based on the following: class ORGANISATION { char Address[20]; double Budget, Income; protected: void compute(); public: ORGANISATION(); void get(); void show(); }; class WORKAREA: public ORGANISATION { char Address[20]; int protected: double pay; void calculate(); public: WORKAREA(); void void display(); }; class SHOWROOM: private ORGANISATION { char Address[20]; Area; double Sale; public: SHOWROOM(); void enter();
XII-COmputer-Science.docx