A simple command-line mortgage calculator written in Java. Enter a principal amount, annual interest rate, and loan period, and it calculates your monthly payment.
Check your versions with:
java -version
mvn -version-
Clone the repository
git clone https://github.com/jesusb25/mortgage-cli.git cd mortgage-cli -
Build the project
mvn compile
-
Run it
mvn exec:java
-
Follow the prompts:
Principal Amount Borrowed: 300000 Annual Interest Rate: 6.5 Loan Period (Years): 30 Your monthly payment is: $1,896.20
mvn test- Interest rate is entered as a percentage (e.g.
6.5for 6.5%), not a decimal. - Monthly payments are rounded up to the nearest penny.