银行提供了整存整取定期储蓄业务,其存期分为一年、两年、三年或五年,到期取款时,银行应支付的本息分别是多少?
package com.hanyi;
import java.util.Scanner;
public class zuoye3 {
public static void main(String[]args){
int custNO;
System.out.print("请输入本金: ");
Scanner input=new Scanner(System.in);
custNO=input.nextInt();
System.out.println("本金为:"+custNO);
double Firstyear=custNO+custNO*0.0225;
double Thesecondyear=custNO+custNO*0.027*2;
double Thethirdyear=custNO+custNO*0.0324*3;
double Thefifthyear=custNO+custNO*0.036*5;
System.out.println("存取一年后的本息是:"+Firstyear);
System.out.println("存取二年后的本息是:"+Thesecondyear);
System.out.println("存取三年后的本息是:"+Thethirdyear);
System.out.println("存取五年后的本息是:"+Thefifthyear);
}
}
输出结果: