Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Conceptual Database Design An Entity Relationship Approach

Authors: Carol Batini, Stefano Ceri, Shamkant B. Navathe

1st Edition

0805302441, 978-0805302448

More Books

Students also viewed these Databases questions

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago