0
Hello! I am trying to develop a simple program that does an automatic accounting calculation, however, the condition within the for(while, while, if / Else, either) does not maintain its values. The repetition is executed 12~13 times and in all of them the output value is not changed. Because exactly the values within the loops are zeroed and displayed as if only one account had been 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);
}
}
You have the same
x
to something, or you’ll never get out...– CesarMiguel
Clarifying Cesarmiguel’s Commission: Following
JOptionsPane.ShowMess.....
equalsx
toValorSaida
– ramaral