//
//  File:  student.h
//
//  Purpose: Declare a class to maintain a record for a student.  This
//  is drastically simplified version of what you might see in
//  practice.  It is good enough for our purpose, however, which is to
//  demonstrate the use of map and multimap container classes from the
//  standard library (STL).
//

#ifndef _student_h_
#define _student_h_

#include <string>

//  Class declaration for Student_Record.  Note that I have included a
//  default constructor for the class.  You MUST give a default
//  constructor for STL maps to compile properly. 
//
class StudentRecord {
  friend std::ostream& operator << ( std::ostream& outstr,
				     const StudentRecord& student );
public:
  StudentRecord( );  // default constructor -- one MUST exist for a map
  StudentRecord( const std::string &id_in,
		 const std::string &cl_in,
		 const std::string &ssn_in,
		 float tuition_in=0.0, int credits_in=0,
		 float g_pts_in=0.0 );
  void pay( float tuition );
  void add_grades( int credits, float grade_sum );
  float gpa( ) const;
  const std::string & get_id () const { return user_id_; }
  const std::string & get_year () const { return year_; }
  const std::string & get_ssn () const { return ssn_; }
  float get_tuition () const { return tuition_paid_; }

protected:   // note the use of the _ at the end of the names
             // this is a typical method of distinguish member
             // variables inside the code
  std::string user_id_;
  std::string year_;
  std::string ssn_;
  float  tuition_paid_;
  int    credits_earned_;
  float  grade_points_;
};

#endif



