So i am supposed to calculate someones savings+their interest rate for each month, but it only wants me to display the 6th month. I am lost how to get to the 6th month. I made the code work for the first one and for an example i used 100 as the savings and .05 as the interest. any help would be appreciated. Code so far is:
import java.util.Scanner; import javax.swing.JOptionPane; //September 19, 2012 pg 77 #2.13 public class Pg77 { public static void main(String[] args) { String numtxt= JOptionPane.showInputDialog("Enter a monthly savings amount."); Double savings = Double.parseDouble(numtxt); numtxt = JOptionPane.showInputDialog("Enter annual interest rate as a decimal i.e. 5%=.05"); Double arate = Double.parseDouble(numtxt); Double rate=arate/12; Double interest=rate*savings; JOptionPane.showMessageDialog(null, savings + "*" + rate + "=" + interest); Double year1=interest+savings; JOptionPane.showMessageDialog(null, savings + "+" + interest + "=" + year1); } }