/* Student.h declares class Student.
 * ...
 *******************************************************/

#ifndef STUDENT                           // compile-once
#define STUDENT                           //  wrapper

#include <iostream>                       // istream, ostream
#include <string>                         // string
using namespace std;

class Student
{
 public:                                  // The Interface
                                          //  constructors
   Student();
   Student(long idNumber, const string & firstName, 
            const string & lastName, const string & year,
            double credits, double gpa);
                                          //  accessors
   long   getID() const;
   string getFirstName() const;
   string getLastName() const;
   string getYear() const;
   double getCredits() const;
   double getGPA() const;
                                          //  relational ops
   bool operator== (const Student& rightOperand) const;
   bool operator!= (const Student& rightOperand) const;
   bool operator<  (const Student& rightOperand) const;
   bool operator>  (const Student& rightOperand) const;
   bool operator<= (const Student& rightOperand) const;
   bool operator>= (const Student& rightOperand) const;
                                          //  I/O
   void read(istream& in);
   void print(ostream& out) const;
   // iostream operators are also defined below

 private:                                 // Implementation Details
                                          // Examples:
  long   myIDNumber;                      //   123456789
  string myFirstName,                     //   Jane
         myLastName,                      //   Doe
         myYear;                          //   Senior
  double myCredits,                       //   15.0
         myGPA;                           //   3.75
};



// ******** Member Operations ***********************************
// -------- Accessors ----------------------------------
inline long Student::getID() const
{
   return myIDNumber;
}

inline string Student::getFirstName() const
{
   return myFirstName;
}

inline string Student::getLastName() const
{
   return myLastName;
}

inline string Student::getYear() const
{
   return myYear;
}

inline double Student::getCredits() const
{
   return myCredits;
}

inline double Student::getGPA() const
{
   return myGPA;
}

// -------- relational operators ---------------------------------
inline bool Student::operator==(const Student & rightOperand) const
{
   return myIDNumber == rightOperand.getID();
}

inline bool Student::operator!=(const Student & rightOperand) const
{
   return myIDNumber != rightOperand.getID();
}

inline bool Student::operator<(const Student & rightOperand) const
{
   return myIDNumber < rightOperand.getID();
}

inline bool Student::operator>(const Student & rightOperand) const
{
   return myIDNumber > rightOperand.getID();
}

inline bool Student::operator<=(const Student & rightOperand) const
{
   return myIDNumber <= rightOperand.getID();
}

inline bool Student::operator>=(const Student & rightOperand) const
{
   return myIDNumber >= rightOperand.getID();
}

// ---------- I/O operators ---------------------------------------

inline istream& operator>>(istream& in, Student& aStudent)
{
   aStudent.read(in);
   return in;
}

inline ostream& operator<<(ostream& out, const Student& aStudent)
{
   aStudent.print(out);  // tell aStudent to print itself
   return out;
}

#endif

