This Java program calculates compound interest earned on a principal amount over a number of years at a given interest rate. The user provides the principal, annual interest rate, and number of years as command line arguments. The program uses the formula to calculate compound interest by multiplying the principal by (1 + interest rate/100) raised to the power of number of years, and outputs the interest amount.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
30 views1 page
Calculating Compound Interest
This Java program calculates compound interest earned on a principal amount over a number of years at a given interest rate. The user provides the principal, annual interest rate, and number of years as command line arguments. The program uses the formula to calculate compound interest by multiplying the principal by (1 + interest rate/100) raised to the power of number of years, and outputs the interest amount.