/* Student.h contains the interface for class Student.
 * ...
 *******************************************************/

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

#include <iostream.h>                     // istream, ostream
#include <string>                         // string

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 IDNumber() const;
   string FirstName() const;
   string LastName() const;
   string Year() const;
   double Credits() const;
   double GPA() 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);               //   called by operator>>
   void Print(ostream & out) const;       //   called by operator<<

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


// ******** Non-member Operations *******************************
// -------- insertion (input) -----------------------------------
inline istream& operator>> (istream & in, Student & theStudent)
{
   theStudent.Read(in);
   return in;
}

// -------- extraction (output) ---------------------------------
inline ostream& operator<< (ostream & out, const Student & theStudent)
{
   theStudent.Print(out);
   return out;
}

// ******** Member Operations ***********************************
// -------- Accessor functions ----------------------------------
inline long Student::IDNumber() const
{
   return myIDNumber;
}

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

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

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

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

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

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

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

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

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

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

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

#endif

