You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.4 KiB
44 lines
1.4 KiB
5 months ago
|
#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
|