Question: Write in Python the following Question 4: Employee.py 25 Marks Create a class Emp with 3 instance variables named: emp_id, emp_name and pay. In this,
Write in Python the following

Question 4: Employee.py 25 Marks Create a class Emp with 3 instance variables named: emp_id, emp_name and pay. In this, emp_id and emp_name are the strings and pay data type is a float. This class also has a member function 'total_salary()' this method will compute the total salary of employees. The total salary should be sum of all allowances using: Total_salary=(pay+house+hosp+bonus)-Insurance House allowance is 10% of pay. Medical allowance is 5% of pay. bonus is 8% of pay. insurance is 10% of pay. Sample Input: Enter the employee id:1 Enter the employee name: Bob Enter the pay:2000 Sample Output: Employee Id: 1 Employee Name: Bob Total Salary:2260.00
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
