#ifndef STUDENT_H #define STUDENT_H #include "person.h" class Student : public Person { // public inheritance public: // We call the base class constructor in initializer list Student(int s, const string & n = "", double g = 0.0) : Person(s,n), gpa(g){ // do nothing } // The copy constructor calls base class copy constructor Student(const Student & rhs) : Person(rhs), gpa(rhs.gpa){ // do nothing } // The assignment operator calls base class operator= Student & operator=(Student & rhs) { if(this != &rhs) { Person::operator=(rhs); gpa = rhs.gpa; } return *this; } double getGpa() const { return gpa; } void print(ostream & out = cout) const { Person::print(out); out << ", " << gpa; } private: // Note ssn and name are inherited instance variables double gpa; }; #endif