private void setLoanTermInYears(Loan loan) throws LoanEntryException {
        String termYears_str = readLoanTermInYears();
        
        // Loan term in years
       float termYears = 0;         // in years
       
       try {
            termYears = (termYears_str != null)? 
                    Float.parseFloat(termYears_str): 0; 
            
            if (termYears <= 0) {
                throw new LoanEntryException(
                     "Loan term should a zero or a (postive) number of years");
            }
            
            loan.setTermYear(termYears);
       } catch (NumberFormatException ex) {
           throw new LoanEntryException(
                   "Please enter a valid loan term in years.");
       }   
    }