Question: Create a Java application that calculates a loan payment based on the following formula: Payment = Amount of Loan * Interest Rate / 1-(1+Interest Rate)^-Months

Create a Java application that calculates a loan payment based on the following formula:

Payment = Amount of Loan * Interest Rate / 1-(1+Interest Rate)^-Months of loan

User input must follow the format (amount; rate; months). Hint: clean user input.

Requirements:

Obtain the input from user in "(Loan; rate; months)" format.

Extract variable values using substring and indexOf methods.

Clean loan amount and interest rate and convert to double types.

Convert annual percentage into monthly ratio (decimal value).

Accurately calculate monthly payment using provided formula

Monthly payment does not loose mathematical precision (two decimal points).

Display the loan terms and monthly payment.

Format amount as currency using NumberFormat.

Format interest rate as percent using NumberFormat.

Example of output is below:

Enter the terms of your car purchase in the following format: (Car Price; Annual Interest Rate; Loan Length in Months) Example: ($25,000.00; 2.99%; 60) Example: (25000.00; 2.99; 48) Example: ($30,000; 1.45%; 60) (25000.00; 1.49; 36) --------------------------------- ****************************************************************************** Car price (loan amount): $25,000.00 Annual Interest Rate: 1.49% Loan length in months 36 ---- Your monthly payment is: $710.51 ---- ******************************************************************************

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!