Assignment No. 03 Semester: Spring 2021 CS304-Object Oriented Programming
Assignment No. 03 Semester: Spring 2021 CS304-Object Oriented Programming
03 Total Marks: 20
Semester: Spring 2021
Due Date: 19/07/2021
CS304- Object Oriented Programming Lecture Covered: 23 -
29
Objective
The objective of this assignment is:
To give you the idea of practical implementation of C++ Inheritance and Polymorphism.
Uploading instructions:
Your assignment should be in .CPP format (Any other formats like scan images, PDF, zip, doc, rar and
bmp etc. will not be accepted).
Save your assignment with your ID (e.g. bc000000000.CPP).
No assignment will be accepted through email.
It should be clear that your assignment will not get any credit if:
Lectures Covered:
Assignment No. 03
A company pays its employees on a weekly basis. The employees are of two types:
1. Salaried Employees
2. Hourly Employees
Salaried employees are paid with a fixed weekly salary, regardless of the number of hours they worked.
Hourly employees are paid by the hour and receive overtime pay for all hours worked in excess of 40 hours. If
they work less than 40 hours then their salary will be:
Salary = wage*hours
If they work more than 40 hours their salary will be calculated using the given formula:
Salary = (40*wage) +((hours-40)*wage*1.5)
Where wage per hour will be 400 PKR.
The company wants to implement a C++ program that performs its payroll calculations. You are required to use
concept of Polymorphism to generate the sample output. The detail of data members and member functions for
each class is provided in the given class diagram. It is part of your assignment to understand the class diagram and
then implement the class diagram into C++ coding.
Solution Guidelines:
You have to use concept of Polymorphism to generate the sample output.
Sample Output:
Best of luck!
NOTE: Do not put any query on MDB about this assignment, if you have any query then email at
[email protected]. Furthermore, if any student found cheating from any other student or from online forums then
he/she will be awarded ZERO right away and strict disciplinary action will be taken against the student.