Hi,
I have to do a program,that is using inheritance.There is a base class person and two derived classes,worker and manager.I have to enter the details of the person.The details of worker and manager are same except salary.i.e.,name designation etc.we can write a function to get the details in the base class. But the salary calculation should be done in the derived class itself.shouldn't ? And should display these details. If the person is a worker we should calculate the salary in the worker class.If the person is a manager salary should calculate in the manager class.At last the result,i.e., name,designation and salry sould be diplayed.
How this classes' object should be connected to diplay all the details?
Please help me as soon as possible.I would be very thankful to u if I provide a solution to this priblem.
Thanks a lot.
I have to do a program,that is using inheritance.There is a base class person and two derived classes,worker and manager.I have to enter the details of the person.The details of worker and manager are same except salary.i.e.,name designation etc.we can write a function to get the details in the base class. But the salary calculation should be done in the derived class itself.shouldn't ? And should display these details. If the person is a worker we should calculate the salary in the worker class.If the person is a manager salary should calculate in the manager class.At last the result,i.e., name,designation and salry sould be diplayed.
How this classes' object should be connected to diplay all the details?
Please help me as soon as possible.I would be very thankful to u if I provide a solution to this priblem.
Thanks a lot.