You are on page 1of 3

Object Oriented Programming CSC-205

Lab Week# 01

Class: A class is a definition of objects of the same kind. In other words, a class is a blueprint,
template, or prototype that defines and describes the static attributes and dynamic behaviors
common to all objects of the same kind.

Instance: An instance is a realization of a particular item of a class. In other words, an instance


is an instantiation of a class. All the instances of a class have similar properties, as described in
the class definition. For example, you can define a class called "Student" and create three
instances of the class "Student" for "Peter", "Paul" and "Pauline".
Instruction:

For every lab task submission create folder with your id and lab# for example 1111_lab01 save
all your programs in that folder

Exercise:

1. Create a class Professor

2. Having member data or attributes

a. ID
b. Name
c. Department
d. Salary
3. Have member functions

a. setProData()
b. getProData()
4. after compilation and running the program save it as instructed. 5. Create Employee Class
with same specification as mention for professor but you have to add some other data to input
for the employee like

a. Basic Salary
b. Home Allowance
c. Transport Allowance
d. Medical Allowance
e. function calcSalary()
6. calcSalary() will calculate Gross Salary and Net Salary a. Gross Salary = Sum of basic and all
allowances b. Net Salary = Income Tax deducted from Gross Salary.

You might also like