26 lines
630 B
C++
26 lines
630 B
C++
#ifndef EXAMPLE25_STUDENT_H
|
|
#define EXAMPLE25_STUDENT_H
|
|
|
|
#include <iostream>
|
|
#include "Person.h"
|
|
|
|
class Student : public Person {
|
|
//class Student : virtual public Person {
|
|
protected:
|
|
std::string faculty;
|
|
double avgGrade;
|
|
public:
|
|
Student(std::string n, std::string f, double g) : Person(n), faculty(f), avgGrade(g) {
|
|
};
|
|
virtual ~Student() {
|
|
}
|
|
virtual void print() const {
|
|
std::cout << "Student: " << name << " " << faculty << " " << avgGrade << std::endl;
|
|
}
|
|
virtual std::string department() const {
|
|
return faculty;
|
|
}
|
|
};
|
|
|
|
#endif //EXAMPLE25_STUDENT_H
|