You are on page 1of 6

REPORT OF SESSIONAL # 02

SUBMITED BY:MAHNOOR NADEEM

SUBMTTED TO:SAJID ALI GILAL

ROLL NO:FA19-BEE-098

CODE:
// MAHNOOR NADEEM //

#include <iostream>

using namespace std;

class Organization{

protected :

string name,scale;

float salary,newsalary;

int i;

public :

void input(){

cout<<" Enter the Name : ";

cin>>name;

cout<<" Enter the Scale : ";

cin>>scale;

cout<<" Enter the Salary : ";


cin>>salary;

void display(){

cout<<" Name : "<<name<<endl;

cout<<" Scale : "<<scale<<endl;

cout<<" Salary : "<<salary<<endl;

void increment(){

cout<<" Enter the Annual increment value in % : ";

cin>>i;

void addition(){

float addition = (salary*i)/100;

newsalary = salary + addition;

cout<<" New Salary is : "<<newsalary<<endl;

};

class Management : public Organization{

public :

void input(){

cout<<" Enter the data For Management : "<<endl;

Organization :: input();
}

void display(){

Organization :: display();

};

class Facility : public Organization{

public :

void input(){

cout<<" Enter the data For Facility : "<<endl;

Organization :: input();

void display(){

Organization :: display();

};

class Staff : public Organization{

public :

void input(){

cout<<" Enter the data For Staff : "<<endl;

Organization :: input();

void display(){
Organization :: display();

};

int main()

int k = 0;

Management m1;

Facility f1;

Staff s1;

cout<<" Press given to Numbers To enter the data : "<<endl;

cout<<" For Facility : 1 "<<endl;

cout<<" For Management : 2 "<<endl;

cout<<" For Staff : 3 "<<endl;

cin>>k;

switch(k) {

case(1) :

f1.input();

f1.display();

f1.increment();

f1.addition();;

break;
case(2) :

m1.input();

m1.display();

m1.increment();

m1.addition();

break;

case(3) :

s1.input();

s1.display();

s1.increment();

s1.addition();

break;

default :

cout<<" Doesn`t Match any case /! "<<endl;

return 0;

}
CRITICAL ANALYSIS:

In above programe,I havr designed a basic class organization which is consist of derived class
such as management, faculty and staff.User has been given choice to choose whether he wants
to enter or display employee's data.Also salary conditions are managed.At the end,I have
displayedtheir scales and increments.

You might also like