#include #include using namespace std; class Staff{ public: int code; string name; public: Staff(){} Staff(int code, string name){ this->code = code; this->name = name; } Staff(const Staff &s){ this->code=s.code; this->name = s.name; } int getCode(){ return code; } void setCode(int c){ code = c; } string getName(){ return name; } void setName(string n){ name = n; }; class Faculty: public Staff{ public: int department; string subjectTaken; string researchArea; Faculty(int code,string name,int department, string subjectTaken, string researchArea):Staff(code,name) { this->department = department; this->subjectTaken = subjectTaken; this->researchArea = researchArea; } Faculty() { } Faculty(const Faculty &f){ code = f.code; name = f.name; department = f.department; subjectTaken = f.subjectTaken; researchArea = f.researchArea; } int getDepartment() { return department; } void setDepartment(int department) { this->department = department; } string getSubjectTaken() { return subjectTaken; } void setSubjectTaken(string subjectTaken) { this->subjectTaken = subjectTaken; } string getResearch Area() { return researchArea; } void setResearch Area(string research Area) { this->researchArea = researchArea; } }; class Typist: public Staff{ public: string office; double speed; public: Typist(int code,string name,string office, double speed):Staff(code,name) { this->office office; this->speed speed; } Typist() { } Typist(const Typist &t){ code = t.code; name = t.name; office = t.office; speed = t.speed; } string getOffice() { return office; } void setOffice(string office) { this->office office; } double getSpeed() { return speed; } void setSpeed(double speed) { this->speed speed; } }; class Typist: public Staff{ public: string office; double speed; public: Typist(int code,string name,string office, double speed):Staff(code,name) { this->office office; this->speed speed; } double calculate Salary(){ return 1000; } }; class Officer:public Staff{ int rank; char grade; public: Officer(int code, string name,int rank, char grade):Staff(code,name) { this->rank = rank; this->grade = grade; } Officer({} Officer(const Officer &o){ code= o.code; name = o.name; rank = o.rank; grade = o.grade; } int getRank() { return rank; } void setRank(int rank) { this->rank rank; } char getGrade() { return grade; } void setGrade(char grade) { this->grade grade; } class Permanent:public Typist{ double salary; public: Permanent(int code,string name,string office, double speed, double salary): Typist(code,name, office,speed){ this->salary salary; } Permanent(const Permanent &p){ salary = p.salary; code = p.code; Permanent({} code = p.code; name = p.name; office = p.office; speed = p.speed; name = p.name; } void setSalary(double s){ salary = s; } double calculateSalary(){ return salary; } }; class Casual:public Typist{ double dailyWage; public: Casual(int code,string name,string office, double speed, double dailyWage):Typist(code,name,office,speed){ this->dailyWage = dailyWage; } code = p.code; Casual(){ Casual(const Casual &p){ dailyWage = p.dailyWage; code = p.code; name = p.name; office = p.office; speed = p.speed; name = p.name; } void setdailyWage(double w){ dailyWage = w; } double calculateSalary(){ return 30*dailyWage; } }; int main(){ Staff s(101,"Jack"); cout<
#include #include using namespace std; class Staff{ public: int code; string name; public: Staff(){} Staff(int code, string name){ this->code = code; this->name = name; } Staff(const Staff &s){ this->code=s.code; this->name = s.name; } int getCode(){ return code; } void setCode(int c){ code = c; } string getName(){ return name; } void setName(string n){ name = n; }; class Faculty: public Staff{ public: int department; string subjectTaken; string researchArea; Faculty(int code,string name,int department, string subjectTaken, string researchArea):Staff(code,name) { this->department = department; this->subjectTaken = subjectTaken; this->researchArea = researchArea; } Faculty() { } Faculty(const Faculty &f){ code = f.code; name = f.name; department = f.department; subjectTaken = f.subjectTaken; researchArea = f.researchArea; } int getDepartment() { return department; } void setDepartment(int department) { this->department = department; } string getSubjectTaken() { return subjectTaken; } void setSubjectTaken(string subjectTaken) { this->subjectTaken = subjectTaken; } string getResearch Area() { return researchArea; } void setResearch Area(string research Area) { this->researchArea = researchArea; } }; class Typist: public Staff{ public: string office; double speed; public: Typist(int code,string name,string office, double speed):Staff(code,name) { this->office office; this->speed speed; } Typist() { } Typist(const Typist &t){ code = t.code; name = t.name; office = t.office; speed = t.speed; } string getOffice() { return office; } void setOffice(string office) { this->office office; } double getSpeed() { return speed; } void setSpeed(double speed) { this->speed speed; } }; class Typist: public Staff{ public: string office; double speed; public: Typist(int code,string name,string office, double speed):Staff(code,name) { this->office office; this->speed speed; } double calculate Salary(){ return 1000; } }; class Officer:public Staff{ int rank; char grade; public: Officer(int code, string name,int rank, char grade):Staff(code,name) { this->rank = rank; this->grade = grade; } Officer({} Officer(const Officer &o){ code= o.code; name = o.name; rank = o.rank; grade = o.grade; } int getRank() { return rank; } void setRank(int rank) { this->rank rank; } char getGrade() { return grade; } void setGrade(char grade) { this->grade grade; } class Permanent:public Typist{ double salary; public: Permanent(int code,string name,string office, double speed, double salary): Typist(code,name, office,speed){ this->salary salary; } Permanent(const Permanent &p){ salary = p.salary; code = p.code; Permanent({} code = p.code; name = p.name; office = p.office; speed = p.speed; name = p.name; } void setSalary(double s){ salary = s; } double calculateSalary(){ return salary; } }; class Casual:public Typist{ double dailyWage; public: Casual(int code,string name,string office, double speed, double dailyWage):Typist(code,name,office,speed){ this->dailyWage = dailyWage; } code = p.code; Casual(){ Casual(const Casual &p){ dailyWage = p.dailyWage; code = p.code; name = p.name; office = p.office; speed = p.speed; name = p.name; } void setdailyWage(double w){ dailyWage = w; } double calculateSalary(){ return 30*dailyWage; } }; int main(){ Staff s(101,"Jack"); cout<
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
#include
#include
using namespace std;
class Staff{
public:
int code;
string name;
public:
Staff(){}
Staff(int code, string name){ this->code = code; this->name = name;
} Staff(const Staff &s){ this->code=s.code; this->name = s.name;
} int getCode(){ return code;
} void setCode(int c){ code = c;
}
string getName(){ return name;
}
void setName(string n){ name = n;
};
class Faculty: public Staff{
public:
int department;
string subjectTaken;
string researchArea;
Faculty(int code,string name,int department,
string subjectTaken, string researchArea):Staff(code,name) {
this->department = department;
this->subjectTaken = subjectTaken;
this->researchArea = researchArea;
}
Faculty() { }
Faculty(const Faculty &f){
code = f.code;
name = f.name;
department = f.department;
subjectTaken = f.subjectTaken;
researchArea = f.researchArea;
}
int getDepartment() { return department;
} void setDepartment(int department) {
this->department = department;
}
string getSubjectTaken() { return subjectTaken;
}
void setSubjectTaken(string subjectTaken) { this->subjectTaken = subjectTaken;
}
string getResearch Area() { return researchArea;
}
void setResearch Area(string research Area) {
this->researchArea = researchArea;
}
};
class Typist: public Staff{
public:
string office;
double speed;
public:
Typist(int code,string name,string office, double
speed):Staff(code,name) {
this->office office;
this->speed speed;
}
Typist() {
}
Typist(const Typist &t){
code = t.code;
name = t.name;
office = t.office;
speed = t.speed;
}
string getOffice() { return office;
}
void setOffice(string office) { this->office office;
}
double getSpeed() { return speed;
}
void setSpeed(double speed) { this->speed speed;
}
};
class Typist: public Staff{
public:
string office;
double speed;
public:
Typist(int code,string name,string office, double
speed):Staff(code,name) {
this->office office;
this->speed speed;
}
double calculate Salary(){ return 1000;
}
};
class Officer:public Staff{
int rank;
char grade;
public:
Officer(int code, string name,int rank, char grade):Staff(code,name) {
this->rank = rank;
this->grade = grade;
}
Officer({}
Officer(const Officer &o){ code= o.code;
name = o.name; rank = o.rank; grade = o.grade;
}
int getRank() { return rank;
}
void setRank(int rank) { this->rank rank;
}
char getGrade() { return grade;
}
void setGrade(char grade) { this->grade grade;
}
class Permanent:public Typist{
double salary;
public:
Permanent(int code,string name,string office, double speed, double
salary): Typist(code,name, office,speed){
this->salary salary;
} Permanent(const Permanent &p){ salary = p.salary; code = p.code;
Permanent({}
code = p.code;
name = p.name; office = p.office;
speed = p.speed;
name = p.name;
}
void setSalary(double s){
salary = s;
}
double calculateSalary(){ return salary;
}
};
class Casual:public Typist{ double dailyWage;
public:
Casual(int code,string name,string office,
double speed, double
dailyWage):Typist(code,name,office,speed){
this->dailyWage = dailyWage;
} code = p.code;
Casual(){
Casual(const Casual &p){
dailyWage = p.dailyWage;
code = p.code;
name = p.name; office = p.office;
speed = p.speed;
name = p.name;
}
void setdailyWage(double w){ dailyWage = w;
} double calculateSalary(){ return 30*dailyWage;
}
}; int main(){
Staff s(101,"Jack");
cout<
![Staff
code
Name
Faculty
Officer
Department
Typist
Rank
Subject Taken
Office
Grade
Research Area
Speed
Permanent
Casual
Salary
daily wages
1. Write getter/setters, display function, parameterized, default and copy constructor.
2. Write a calculateSalary() function in the Typist class and override the definition in
permanent and casual.
3. Write a 'main' function and create objects of all classes in main and call the public
methods of all classes.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fcdacd494-4969-4d11-b549-a20230cfbacd%2F69e2c08b-745d-4310-a075-8da5c4a68fbf%2F0lqb5op_processed.jpeg&w=3840&q=75)
Transcribed Image Text:Staff
code
Name
Faculty
Officer
Department
Typist
Rank
Subject Taken
Office
Grade
Research Area
Speed
Permanent
Casual
Salary
daily wages
1. Write getter/setters, display function, parameterized, default and copy constructor.
2. Write a calculateSalary() function in the Typist class and override the definition in
permanent and casual.
3. Write a 'main' function and create objects of all classes in main and call the public
methods of all classes.
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY