Question: Write a java program named CompoundInterest that prompts the user for information via JOptionPane, and calculates the compound interest accrued. The formula for compound interest

Write a java program named CompoundInterest that prompts the user for information via JOptionPane, and calculates the compound interest accrued. The formula for compound interest (including principal) is: A = P (1 + r/n) nt where A = final amount P = initial principal balance r = interest rate n = number of times interest applied per time period t = number of time periods elapsed Time period units will be by year, and interest will be applied every month per year (i.e. 12 times per time period). For example, the total amount accrued from compound interest on an original principal of $5000 at a rate of 2.35% per year compounded monthly over 5.5 years is $689.15 Display the compound interest accrued. Continue to perform calculations until the user decides to quit. Your program must include a method named computeInterest that accepts all the required information and returns the interest calculated (i.e. without the principal).

Notes: - Assume that the user will enter all valid input - You must use Math.pow to compute the power - (not required) to format output to 2 decimal places, use String.format() e.g. String.format("%.2f", value)

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!