Statement:

-Use while loop or for loop

-You are require to ask the user to enter their

~Annual Rate

~Total Investment

~Year Of Investment

-Then if the user enter 0 for either 1 above, display a error message says "Error".

-The formula is( i not sure correct anot also....):

Investment=(rate/100*investment*year)+investment

Here is what I had done:

import javax.swing.JOptionPane;

public class Haha{

public static void main (String[] args){

double investment=0.0,rate=0.0,year=0.0;

rate=Double.parseDouble(JOptionPane.showInputDialo g("Please Input Your Annual"));

investment=Double.parseDouble(JOptionPane.showInpu tDialog("Please Input Your Total Investment"));

year=Double.parseDouble(JOptionPane.showInputDialo g("Please Input Your Year Of Investment"));

double rate=x,investment=y,year=z;

while if(x==0){

System.out.println("Error");

}else{

y=x/100*y*z+y

}

}

}

It's worng XD can anyone help me....please?