private void setAPR(Loan loan) throws LoanEntryException {
       String apr_str = readAPR();
        
        // APR in decimal point
       double interest = 0d;
       
       try {
            interest = Double.parseDouble(apr_str);
            
             if (interest < 0) {
                   throw new LoanEntryException(
                           "loan annual percentage rate should be "
                           + "a positive percentage number format");
               }
            
            interest = 
                    (interest > 0)? Double.parseDouble(apr_str) / 100 : 0d;                        
             
             loan.setAnnualPercentageRage(interest);
        } catch (NumberFormatException ex) {
           throw new LoanEntryException(
                   "Please enter a valid annual percentage rate.");
        }   
    }