C++ Programming Inheritance Help Complete the University Project. All other members will inherit the class Person. Add a multiple inheritance scenario where a student can
C++ Programming Inheritance Help
Complete the University Project. All other members will inherit the class Person.
Add a multiple inheritance scenario where a student can be also be staff.
Store instances of all classes in double linked lists that are sorted by last name.
Have utilities that will allow:
1. add a record
2. modify or find a record
3. delete a record
4. display all records
Faculty.h
//Faculty.h #include"Person.h" #ifndef FACULTY_H #define FACULTY_H class Faculty : public Person{ public: Faculty(): Person(){} private: string academic_dpt; string office_number; }; #endif
Person.cpp
//Person.cpp #include
Person::Person(){ fname = ""; lname = ""; id =""; email =""; dob = ""; date_hired = ""; termination_date = ""; title = ""; } Person::Person(string pk){ fname = ""; lname = ""; id =pk; email =""; dob = ""; date_hired = ""; termination_date = ""; title = ""; }
void Person::setName(string f, string l){fname = f; lname = l;} void Person::setID(string pk){id = pk;} void Person::setEmail(string em){email = em;} void Person::setTitle(string t){title = t;} void Person::setStartDate(string dh){ date_hired = dh;} void Person::setTerminationDate(string td){termination_date = td;} void Person::setDateOfBorth(string db){dob = db;} void Person::printPersonelInfo(){ cout <<"Name: "< Person.h //person.h //superclass using namespace std; #ifndef PERSON_H #define PERSON_H class Person{ public: Person(); Person(string); void setName(string, string); void setID(string); void setEmail(string); void setTitle(string); void setStartDate(string); void setTerminationDate(string); void setDateOfBorth(string); void printPersonelInfo(); private: string fname; string lname; string id; string email; string dob; string date_hired; string termination_date; string title; }; #endif Staff.h //Staff.h #include"Person.h" #ifndef STAFF_H #define STAFF_H class Staff: public Person{ private: string organizational_dpt; }; #endif Student.h //Student.h #include"Person.h" #ifndef STUDENT_H #define STUDENT_H class Student: public Person{ private: double gpa; int credits; string start_date; string graduation_date; }; #endif testApp.cpp #include using namespace std; #include"Faculty.h" int main(int argc, char *argv[]) { Faculty prof1; prof1.setName("Drew", "Mehri"); prof1.printPersonelInfo(); system("PAUSE"); return EXIT_SUCCESS; }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started