Hello! I'm trying to develop a simple program that does an automatic accounting calculation, however, the condition within the for (while, do, while, if / else, any) does not keep its values. The repetition is executed 12 ~ 13 times and in all the output value is not changed. Why exactly the values inside the loops are zeroed and displayed as if only one account was made?
public static void main(String[] args)
{
int x;
double percentual=0.005, ValorSaida, ValorPercentual=0;
x=Integer.parseInt(JOptionPane.showInputDialog("Digite o valor depositado mensalmente"));
for(int meses=0; meses<=12; meses++)
{
ValorPercentual=x*percentual;
ValorSaida=x+ValorPercentual;
JOptionPane.showMessageDialog(null, ""+ValorSaida+" "+ValorPercentual);
}
}