diff --git a/graduate.h b/graduate.h new file mode 100644 index 0000000..b6d6202 --- /dev/null +++ b/graduate.h @@ -0,0 +1,44 @@ +#pragma once +#ifndef GRADUATE_H +#define GRADUATE_H +#include +#include +#include +#include "student.h" +using namespace std; +class Graduate : public Student { +protected: + char direction[20]; + char advisorName[20]; +public: + Graduate(); + Graduate(char* sname, char* sid, char* sgender, int y, int m, int d, char* sno, char* sschool, char* sclass, char* + sdirection, char* sadvisor); + ~Graduate() {}; + void setDirction(char* sdirection) { strcpy(direction, sdirection); } + char* getDirction() { return direction; } + void setAdvisorName(char* sadvisor) { strcpy(advisorName, sadvisor); } + char* getAdvisorName() { return advisorName; } + virtual void inputData(); + virtual void displayDetails(); +}; +Graduate::Graduate() :Student() { + strcpy(advisorName, "null_advisorName"); + strcpy(direction, "null_direction"); +} +Graduate::Graduate(char* sname, char* sid, char* sgender, int y, int m, int d, char* sno, char* sschool, char* sclass, + char* sdirection, char* sadvisor) :Student(sname, sid, sgender, y, m, d, sno, sschool, sclass) { + strcpy(advisorName, sdirection); + strcpy(direction, sadvisor); +} +void Graduate::inputData() { + Student::inputData(); + cout << "direction: "; cin >> direction; + cout << "advisorName: "; cin >> advisorName; +} +void Graduate::displayDetails() { + Student::displayDetails(); + cout << "Direction: " << direction << endl; + cout << "Advisor Name: " << advisorName << endl; +} +#endif //GRADUATE_H \ No newline at end of file