public class interest_rate {
public static void main(String []args) {
double balance = 10000.0;
int year=1;
while(balance<=20000) {
balance*=1.07;
System.out.println(year + ".year balance: " + (double)Math.round(balance*100)/100+"$\\");
year++;
}
System.out.println("It took " + (year-1) + " years to reach 20.000$ or more.");
}
}