Search
| Java Loan Calculator Project |
|
| Written by Chris Gountanis | |
|
This program asks user for input amount of the loan, the interest rate and the number of years. The program validates the input checking for valid numeric data before continuing. If the interest rate was entered in percentage form it converts to decimal before calculation process. The program then calculates the monthly payment. The monthly payment total and the input values are displayed rounded to the second decimal place.
Input The inputs for this program are the loan amount, annual interest rate and the number of years for the loan. The interest rate can be entered as a decimal or percentage value. For example .065 or 6.5 will be accepted.
Output The output for the program is the user defined input values as well as the calculated monthly payment.
![]() Process All the input values are accepted from the keyboard. Error handling is in place to validate the input for numeric values. The program will not continue until a valid input is entered. The input values will be converted from string to a numeric data type. If the interest rate was entered in percentage form it converts to decimal before calculation process. The program uses the following formula for the calculation:
![]()
The final output can now be displayed as all the input and calculations are complete. Numeric values with more than 2 decimal places will be rounded to the second decimal place.
Design Code
Downloads |
|
| Last Updated on Saturday, 09 February 2008 07:21 |



