/**
 * Class that represents pass/fail grades (implementing the Grade interface).
 *   @author Dave Reed
 *   @version 11/1/17
 */
class PassFailGrade implements Grade {
   private int courseHours;
   private boolean coursePass;

   /**
    * Constructs a letter grade.
    *   @param g whether the student passed or not (true/false)
    *   @param hrs the number of credit hours
    */
   public PassFailGrade(boolean g, int hrs) {
      this.coursePass = g;
      this.courseHours = hrs;
   }
   
   /**
    * Accessor method for the number of course hours.
    *   @return the course hours
    */
   public int hours() {
      return this.courseHours;
   }
   
   /**
    * Calculates the grade points earned.
    *   @return the grade points (grade * hours)
    */
   public double gradePoints() {
      if (this.coursePass) {
         return 4.0*this.courseHours;
      }
      else {
         return 0.0;
      }
    }
}

