Create the class Employee with name, Empid, address, mailid, mobileno as data members.Inherit the classes Asstprofessor, Associateprofessor and Professor from employee class.Add Basic Pay (BP) as the member of all the inherited classes.Calculate DA as 97% of BP, HRA as 10% of BP, PF as 12% of BP, Staff club fund as 0.1% of BP.Calculate gross salary and net salary.Generate payslip for Asstprofessor categories of employees.Calculate DA as 97% of BP, HRA as 7% of BP, PF as 13% of BP, Staff club fund as 0.1% of BP.Calculate gross salary and net salary.Generate payslip for Associateprofessor categories of employees, Create the objects for the inherited classes and invoke the necessary methods to display the Payslip.Calculate DA as 97% of BP, HRA as 4% of BP, PF as 13% of BP, Staff club fund as 0.2% of BP.Calculate gross salary and net salary.Generate payslip for Professor categories of employees,Choose the options PROGRAMMER 2.ASSISTANT PROFESSOR 3.ASSOCIATE PROFESSOR 4.PROFESSORinput
Question
Create the class Employee with name, Empid, address, mailid, mobileno as data members.Inherit the classes Asstprofessor, Associateprofessor and Professor from employee class.Add Basic Pay (BP) as the member of all the inherited classes.Calculate DA as 97% of BP, HRA as 10% of BP, PF as 12% of BP, Staff club fund as 0.1% of BP.Calculate gross salary and net salary.Generate payslip for Asstprofessor categories of employees.Calculate DA as 97% of BP, HRA as 7% of BP, PF as 13% of BP, Staff club fund as 0.1% of BP.Calculate gross salary and net salary.Generate payslip for Associateprofessor categories of employees, Create the objects for the inherited classes and invoke the necessary methods to display the Payslip.Calculate DA as 97% of BP, HRA as 4% of BP, PF as 13% of BP, Staff club fund as 0.2% of BP.Calculate gross salary and net salary.Generate payslip for Professor categories of employees,Choose the options PROGRAMMER 2.ASSISTANT PROFESSOR 3.ASSOCIATE PROFESSOR 4.PROFESSORinput
Solution
Here is a Python code that implements the requirements:
class Employee:
def __init__(self, name, Empid, address, mailid, mobileno):
Similar Questions
Create a class employee with protected members:Name,age,degree,genderCreate a member function to read the details. Create a derived class department by inheriting the employee class privately.Declare the protected members: department_name, designation.Create a member function to read the details of the department.Create a member function to display the details of employee class and department class.Create a derived class salary by inheriting the employee class privately with protected members: basic payCreate default constructor to read basic pay.Define a member function to calculate the gross pay. Gross_pay=basic_pay+DA+HRADA=30% of basic payHRA =12% of basic payCreate a member function to display the details of employee class and the grosspay.
EX NO: 3 PROGRAM TO GENERATE PAYSLIP USING INHERITANCE AIM To develop a java application to generate pay slip for different category of employees using the concept of inheritance. PROCEDURE 1. Create the class employee with name, Empid, address, mailid, mobileno as members. 2. Inherit the classes programmer, asstprofessor,associateprofessor and …
Define a class Employee. Display the personal salary details of three employeesusing single inheritance
Create a class Employee with members name and ID and a default constructor to read the details of employeeCreate a derived class Salary from employee with members basic pay. Create a default constructor to read the basic pay.Create a derived class loan from salary with members DA,HRA,loan_amout, net_pay.Create a default constructor to read the loan_amount. Define a member function to calculate the netpay.Net_pay= (basic_pay+DA+HRA)-loan_amountDA=30% of basic payHRA =12% of basic pay
Define a class “employee” having employee id, name and salary use accept and to-string method to display and create n employee’s data and find the total salary of all employees and find the name of the employee who is having maximum salary.
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.