package zuoye;
import java.util.Scanner;
public class Rate {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.print("请输入本金:");
Scanner input=new Scanner(System.in);
double pc=input.nextDouble();
System.out.println("本金为:"+pc);
double pc1=pc+pc*0.0225;
double pc2=pc+pc*0.027*2;
double pc3=pc+pc*0.0324*3;
double pc4=pc+pc*0.036*5;
System.out.println("存取一年后的本息是:"+pc1);
System.out.println("存取两年后的本息是:"+pc2);
System.out.println("存取三年后的本息是:"+pc3);
System.out.println("存取四年后的本息是:"+pc4);
}
}
运行代码结果如下