title: Having trouble with a library book class java assignment
body: <p>I have an assignment where I was given a pre-written driver program for a Date class and a LibraryBook class, and I have to write the classes so that they pass a bunch of checks in the driver program. My problem comes with one of the checks where it sees if I will be charged for returning a book on time. Obviously I should be charged $0 but for some reason my program says $15.
  Here's the method for calculating the fine:</p>
  
  <pre><code>    public double getFineAmount(Date dateReturned){
          double fine;
          Date dueDate = this.getDueDate();
          if(dateReturned.isOnOrBefore(dueDate)){
              fine = 0.00;
          }
          else{
              if(this.isFiction){
                  fine = 1.2 * dueDate.getDaysUntil(dateReturned);
                  if(fine &gt; 15){
                      fine = 15.00;
                  }
              }
              else{
                  fine = 1.5 * dueDate.getDaysUntil(dateReturned);
                  if(fine &gt; 20){
                      fine = 20.00;
                  }
              }
          }
          return fine;
      }
  </code></pre>
  
  <p>When the date the book is borrowed is Feb. 10th, 2012 and the due date is March 2nd, 2012 for some reason the isOnOrBefore method returns false. Here is the isOnOrBefore method:</p>
  
  <pre><code>public boolean isOnOrBefore(Date other){
  boolean onOrBefore;
  Scanner sc = new Scanner(other.toString()).useDelimiter("-");
  int otherDay = sc.nextInt();
  int otherMonth = sc.nextInt();
  int otherYear = sc.nextInt();
  if(otherYear &gt;= this.year){
      if(otherMonth &gt;= this.month){
          if(otherDay &gt;= this.day){
              onOrBefore = true;
          }
          else{
              onOrBefore = false;
          }
      }
      else{
          onOrBefore = false;
      }
  }
  else{
      onOrBefore = false;
  }
  return onOrBefore;
  }
  </code></pre>
  
  <p>I believe the problem is caused by a leap year but I don't see what's causing the error. Here's the code to detect a leap year in case it helps</p>
  
  <pre><code>public boolean isLeapYear(){
  boolean leapYear;
  if(this.year % 100 == 0){
      if(this.year % 400 == 0){
      leapYear = true;
      }
      else{
      leapYear = false;
      }
  }
  else{
      if(this.year % 4 == 0){
      leapYear = true;
      }
      else{
      leapYear = false;
      }
  }
  return leapYear;
  }
  </code></pre>
  
  <p>I can post more of the code if needed.</p>