/* Student.cpp implements the non-trivial Student operations.
 * ...
 **************************************************************/

#include "Student.h"                        // class Student
#include <iomanip>                          // setw, setprecision
using namespace std;

// -------- default-value constructor --------------------------
Student::Student ()
{
   myIDNumber = 0;
   myFirstName = "";
   myLastName = "";
   myYear = "";
   myCredits = 0.0;
   myGPA = 0.0;
}

// -------- explicit-value constructor -------------------------
Student::Student (long idNumber, const string & firstName, 
                  const string & lastName, const string & year,
                  double credits, double GPA)
{
   myIDNumber = idNumber;
   myFirstName = firstName;
   myLastName = lastName;
   myYear = year;
   myCredits = credits;
   myGPA = GPA;
}

// -------- input (function member) ----------------------------
void Student::read(istream & in) 
{
   in >> myIDNumber >> myFirstName >> myLastName
      >> myYear >> myCredits >> myGPA;
}

// -------- output (function member) ---------------------------

void Student::print(ostream & out) const
{
   out << setw(9) << myIDNumber << '\t'
       << myFirstName << ' ' << myLastName 
       << '\n' << myYear
       << setprecision(4) << showpoint
       << fixed << setw(8) << myCredits
       << setw(8) << myGPA << endl;
}

