/**
   The Student class is an abstract class that holds
   general data about a student. Classes representing
   specific types of students should inherit from
   this class.
*/

public class Student
{
   private static final int TOTAL_HOURS = 120;
   private static final int GEN_ED_HOURS = 40;
   
   private String name;       // Student name
   private String idNumber;   // Student ID
   private int yearAdmitted;  // Year admitted
   
   // hours that all students have
   protected int genEdHours; // General ed hours taken
   protected int electiveHours; // Elective hours taken

   /**
      The Constructor sets the student's name,
      ID number, and year admitted.
      @param n The student's name.
      @param id The student's ID number.
      @param year The year the student was admitted.
   */

   public Student(String name, String id, int year)
   {
      this.name = name;
      this.idNumber = id;
      this.yearAdmitted = year;
   }

   /**
      The setGenEdHours method sets the number of 
      general ed hours taken.
      @param genEd The general ed hours taken.
   */

   public void setGenEdHours(int genEd)
   {
      genEdHours = genEd;
   }
   
   /**
      The setElectiveHours method sets the number of 
      elective hours taken.
      @param elective The elective hours taken.
   */
   public void setElectiveHours(int elective)
   {
      electiveHours = elective;
   }


   /**
      The toString method returns a String containing
      the student's data.
      @return A reference to a String.
   */
   public String toString()
   {
      String str;

      str = "Name: " + name
         + "\nID Number: " + idNumber
         + "\nYear Admitted: " + yearAdmitted + 
		 "\nHours Remaining: " + getRemainingHours();;
      return str;
   }

   /**
      The getRemainingHours method returns the number of 
	  hours remaining for this student
	  
	  @return The hours remaining for the student.
   */

   public int getRemainingHours()
   {
   	  return TOTAL_HOURS - (electiveHours + genEdHours);
   }
}