Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
39336fd
Exercise 8.3 , 8.4
rudri182 Dec 19, 2017
aad8e2f
Add 8.3 only
rudri182 Dec 19, 2017
e12f647
Exercise 8.3 , 8.4
rudri182 Dec 19, 2017
1fd1b20
Update gitignore
rudri182 Dec 19, 2017
ada8dc6
Add Exercise 8.5
rudri182 Dec 19, 2017
f0b564c
Delete 8.1_bank_accounts.cpp
rudri182 Dec 19, 2017
8dd8510
Update 8.5_master_class_derives_parent_class_property.cpp
rudri182 Dec 19, 2017
520cd9a
ADD .gitignore
rudri182 Dec 20, 2017
36a51a2
Add files via upload
rudri182 Dec 20, 2017
f3ef543
not merging
rudri182 Dec 22, 2017
7d5a473
add 8.6
rudri182 Dec 22, 2017
2a10855
added 8.1 , 8.3 , 8.4 , 8.5
rudri182 Dec 30, 2017
f2ccd4b
Delete balaguru_8.1.exe
rudri182 Dec 30, 2017
302ce2f
Delete main.o
rudri182 Dec 30, 2017
4ab2845
Delete balaguru_8.1.cbp
rudri182 Dec 30, 2017
a48d71a
Delete balaguru_8.1.layout
rudri182 Dec 30, 2017
ecf9090
Delete main.cpp.save
rudri182 Dec 30, 2017
657ae15
Delete balaguru_8.3.cbp
rudri182 Dec 30, 2017
5d5f590
Delete balaguru_8.3.layout
rudri182 Dec 30, 2017
c96cc97
Delete main.cpp.save
rudri182 Dec 30, 2017
50b24bb
Delete main.exe
rudri182 Dec 30, 2017
4225571
Delete main.o
rudri182 Dec 30, 2017
8009878
Delete balaguru_8.exe
rudri182 Dec 30, 2017
1616ebb
Delete main.o
rudri182 Dec 30, 2017
0360f32
Delete balaguru_8.4.cbp
rudri182 Dec 30, 2017
5d62161
Delete balaguru_8.4.depend
rudri182 Dec 30, 2017
9c0f0c2
Delete balaguru_8.4.layout
rudri182 Dec 30, 2017
d227504
Delete main.cpp.save
rudri182 Dec 30, 2017
8e779e2
Delete balaguru_8.5.cbp
rudri182 Dec 30, 2017
78322fe
Delete balaguru_8.5.layout
rudri182 Dec 30, 2017
276a1c1
Delete main.cpp.save
rudri182 Dec 30, 2017
52a3392
Delete 8.6_use_container_class.exe
rudri182 Dec 30, 2017
a2ca116
Delete 8.exe
rudri182 Dec 30, 2017
1603cb9
Delete main.o
rudri182 Dec 30, 2017
1179651
Delete 8.6_use_container_class.cbp
rudri182 Dec 30, 2017
8a83850
Delete 8.6_use_container_class.depend
rudri182 Dec 30, 2017
bef896d
Delete 8.6_use_container_class.exe
rudri182 Dec 30, 2017
8a7d3e9
Delete 8.6_use_container_class.layout
rudri182 Dec 30, 2017
fa9bd23
Delete 8.6_use_container_class.o
rudri182 Dec 30, 2017
92772fb
Delete 8.6_use_container_class.cpp
rudri182 Dec 30, 2017
45b8917
Delete main.cpp.save
rudri182 Dec 30, 2017
35e47cf
Delete main.exe
rudri182 Dec 30, 2017
63e6812
Add files via upload
rudri182 Dec 30, 2017
d893a24
Delete main.o
rudri182 Dec 30, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore/.gitignore

This file was deleted.

111 changes: 111 additions & 0 deletions Exercise_8/8.3_database_of_employee.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
#include <iostream>
#include<cstring>

using namespace std;

class Staff
{
int code ;
string name ;

public:
void get_staff_info()
{
cout <<"\nEnter your code and name :" <<endl;
cin >> code >> name;
cout << "Code :" << code << "\tName :" << name<<endl;
}
};

class Teacher : public Staff
{
string subject ;
string publication ;

public:
void teacher_info()
{
cout <<"\nEnter your subject and publication :"<<endl;
cin >> subject >> publication ;
cout <<"Subject :" << subject << "\tPublication :" << publication <<endl;
}
};

class Typist : public Staff
{
int speed ;

public:
void get_speed()
{
cout <<"\nEnter your speed :";
cin>>speed;
cout <<"Your speed is :" <<speed<<endl;
}
};

class Officer : public Staff
{
public:
string grade;
//take grade from user in main

void get_off_info()
{
cout<<"\nYou are " << grade << " grade officer" <<endl;
}
};

class Regular : public Typist
{
// string type;
public:
Regular()
{
cout <<"\nYou are regular typist." <<endl;
}
};

class Casual : public Typist
{
int daily_wages ;
//take daily_wages from user in main
public:
void casual_typist_info()
{
cout<<"Enter your daily wages :"<<endl;
cin>>daily_wages;
cout <<"\nYou are casual typist and your daily wages are :" << daily_wages<<endl;
}
};
int main()
{
Staff stf;
Teacher tch;
Typist typ;
Casual cas;

cout<<"Enter details as required :" << endl;

stf.get_staff_info();

tch.teacher_info();

typ.get_speed();

cout<<"\nEnter which type of officer you are :"<<endl;
Officer off;
cin >>off.grade;
off.get_off_info();

cout<<"\nEnter which type of typist you are ?"<<endl;
char ch;
cout<<"\n r. Regular Typist \n c. Casual Typist"<<endl;
cin>>ch;
if(ch == 'r')
Regular reg;
else if(ch == 'c')
cas.casual_typist_info();

return 0;
}
134 changes: 134 additions & 0 deletions Exercise_8/8.4_educational_info_staff.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
#include <iostream>
#include<cstring>

using namespace std;

class Staff
{
int code ;
string name ;

public:
void get_staff_info()
{
cout <<"\nEnter your code and name :" <<endl;
cin >> code >> name;
cout << "Code :" << code << "\tName :" << name<<endl;
}
};

class Teacher : public Staff
{
string subject ;
string publication ;

public:
void teacher_info()
{
cout <<"\nEnter your subject and publication :"<<endl;
cin >> subject >> publication ;
cout <<"Subject :" << subject << "\tPublication :" << publication <<endl;
}
};

class Typist : public Staff
{
int speed ;

public:
void get_speed()
{
cout <<"\nEnter your speed :";
cin>>speed;
cout <<"Your speed is :" <<speed<<endl;
}
};

class Officer : public Staff
{
public:
string grade;
//take grade from user in main

void get_off_info()
{
cout<<"\nYou are " << grade << " grade officer" <<endl;
}
};

class Regular : public Typist
{
// string type;
public:
Regular()
{
cout <<"\nYou are regular typist." <<endl;
}
};

class Casual : public Typist
{
int daily_wages ;
//take daily_wages from user in main
public:
void casual_typist_info()
{
cout<<"Enter your daily wages :"<<endl;
cin>>daily_wages;
cout <<"\nYou are casual typist and your daily wages are :" << daily_wages<<endl;
}
};

class Education :Teacher , Officer
{
string gen_edu;
string prof_edu;
char chr;

public:
void get_info_edu()
{
cout<<"\nEnter your designation :" <<endl;
cout<<"\n g. General Education \np. Proffessional Education"<<endl;
cin>>chr;

if(chr == 'g')
cout << "You have general education.";
else if(chr == 'p')
cout<<"You have proffesional education.";
}
};
int main()
{
Staff stf;
Teacher tch;
Typist typ;
Casual cas;
Education edu;

cout<<"Enter details as required :" << endl;

stf.get_staff_info();

tch.teacher_info();

typ.get_speed();

cout<<"\nEnter which type of officer you are :"<<endl;
Officer off;
cin >>off.grade;
off.get_off_info();

cout<<"\nEnter which type of typist you are ?"<<endl;
char ch;
cout<<"\n r. Regular Typist \n c. Casual Typist"<<endl;
cin>>ch;
if(ch == 'r')
Regular reg;
else if(ch == 'c')
cas.casual_typist_info();

edu.get_info_edu();

return 0;
}
61 changes: 61 additions & 0 deletions Exercise_8/8.5_master_class_derives_parent_class_property.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/* Exercise_8_8.5*/
#include <iostream>
#include<cstring>

using namespace std;

class Person
{
public: //as data memebers are protected , it can be used by their subclasses
int per_c ;
string per_n;
};

class Account : Person
{
protected: //as data memebers are protected , it can be used by their subclasses
int pay;
};

class Admin : Person
{
protected : //as data memebers are protected , it can be used by their subclasses
int exp;
};

class Master : Account , Admin
{
public:

void disp_person_info() //displays person's information
{
cout <<"Enter name and code :"<<endl;
cin >> personCode>> personName;
cout<<"Code:"<<personCode<<"\tName:"<<perName<<endl;
}

void get_amount() //it will take amount and display it
{
cout <<"How much amount is paid to you ?"<<endl;
cin >>pay;
cout<<"Your paid amount is :" << pay<<endl;
}

void disp_exp() //displays experience
{
cout<<"How many years of experience do you have ?" <<endl;
cin>> exp;
cout<<"You have " << exp << "year expereince" << endl;
}
};
int main()
{
Master mas;

mas.disp_person_info();
mas.disp_exp();
mas.get_amount();

return 0;
}