版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_38234015/article/details/88352094
import java.util.Scanner;
public class Test2_13 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Enter the monthly saving amount: ");
double amount = input.nextDouble();
input.close();
double value = 0;
for(int i = 0; i < 6; i++) {
value = (amount + value) * (1 + 0.00417);
}
System.out.println("After the sixth month, the account value is $" + value);
}
}