/**
 * Class the models a letter-grade for a course.
 *   @author Dave Reed
 *   @version 4/15/13
 */
class LetterGrade implements Grade {
   private int courseHours;
   private String courseGrade;

   public LetterGrade(String g, int hrs) {
      this.courseGrade = g;
      this.courseHours = hrs;
   }
   
   public int hours() {
      return this.courseHours;
   }
   
   public double gradePoints() {
      if (this.courseGrade.equals("A")) {
         return 4.0*this.courseHours;
      }
      else if (this.courseGrade.equals("B+")){
         return 3.5*this.courseHours;
      }
      else if (this.courseGrade.equals("B")){
         return 3.0*this.courseHours;
      }
      else if (this.courseGrade.equals("C+")){
         return 2.5*this.courseHours;
      }
            else if (this.courseGrade.equals("C")){
         return 2.0*this.courseHours;
      }
      else if (this.courseGrade.equals("D")){
         return 1.0*this.courseHours;
      }
      else {
         return 0.0;
      }
  }
}

