That is correct just don't square the interest.
NewBalance = 1000(1+0.05)^M
Where M is the number of months.
Hey,
I forgot the formula for interest.
The formula sloves this:
Let say you got a savings account and you got $1,000 in it. The interest is 5% every month (i wish) so the formula is 1000 * 1.05 = B B= Balance
But next month it will be 1050 * 1.05 = B
Can you guys give me the formula for this. If i remember right it was like
startbalance [1 + interest ^ 2) * month] = newbalance
But that is wrong i think
Thanks for you help.
EDIT: I think it is this: StartBalance * (1+I)^ number of years
Thanks!
There is my code if you wan to see it:
import java.io.*;
import java.text.NumberFormat;
public class Interest {
public static void main(String args[]) throws IOException {
BufferedReader keyboard =
new BufferedReader(new InputStreamReader(System.in));
double Principal, Rate, Month, Balance;
NumberFormat currency = NumberFormat.getCurrencyInstance();
System.out.print("What Your Starting Balance? ");
Principal = Double.parseDouble(keyboard.readLine());
Rate = 5 / 100.00; /*To change the rate change the 5 to any other number.*/
System.out.print("How many months? ");
Month = Integer.parseInt(keyboard.readLine());
System.out.println("------------------------------");
Balance = Principal * Math.pow( 1.0 + Rate, Month );
System.out.print("Your Balance is: ");
System.out.println(currency.format(Balance));
System.out.println();
}
}
It for school.