parent
58e07e844c
commit
2a43c1b683
@ -0,0 +1,44 @@
|
|||||||
|
#pragma once
|
||||||
|
#ifndef GRADUATE_H
|
||||||
|
#define GRADUATE_H
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
#include <cstring>
|
||||||
|
#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
|
Loading…
Reference in new issue