#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...
icon
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.
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
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
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…
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)
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
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY