You are on page 1of 2

Object Oriented Programming

Lab 7

Read these Instructions Carefully:

• The deadline to submit this lab is 10:20


• This is an individual task. Plagiarism is not allowed, do your own work and do not lend or borrow
code. Anybody found to have copied code will be given a straight
• Add some comments to your code to make it more readable and understandable.
• Best of luck.

Task 1:

Create an Employee Class, the class have the following attributes:

Id, age, hourly_rate, hours_worked, Bonus, Tax, Penalty, Medi_tax

Initialize each attribute using constructor method. Each attribute should be private.

Task 2:
for this class implement following methods:
Print #to display all information of each attribute
Basic_pay #hourly rate * hours worked)
Tax # total applicable taxes on emplyee
Gross_pay #basic pay plus any allowance/deducitons/taxes?

Task 3:
Make a new file “main.py” and import all behaviours of employee class in this new file then try to call
few functions from previous file where those functions are defined.

Task 4: load the given dataset then call tax and gross_pay function from your class for this data.

Task 5: Write functions to:

Find total taxes the company is collecting.

Find total gross_pay the company giving to it’s employee’s

Bonus tasks:

find the id and gross pay of most senior employee of the company.

Modify your code to Add another column to “Basic Pay” in dataset, also print all records.

You might also like