package Demon;
import java.util.Scanner;
public class HW2 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("请输入本金:");
int principal = input.nextInt();
System.out.println("本金为:" + principal);
double year1 = principal * (1+0.0225);
double year2 = principal * (1+0.027*2);
double year3 = principal * (1+0.0324*3);
double year5 = principal * (1+0.036*5);
System.out.println("存取一年后的本息是:" + year1);
System.out.println("存取两年后的本息是:" + year2);
System.out.println("存取三年后的本息是:" + year3);
System.out.println("存取五年后的本息是:" + year5);
}
}
import java.util.Scanner;
public class HW2 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("请输入本金:");
int principal = input.nextInt();
System.out.println("本金为:" + principal);
double year1 = principal * (1+0.0225);
double year2 = principal * (1+0.027*2);
double year3 = principal * (1+0.0324*3);
double year5 = principal * (1+0.036*5);
System.out.println("存取一年后的本息是:" + year1);
System.out.println("存取两年后的本息是:" + year2);
System.out.println("存取三年后的本息是:" + year3);
System.out.println("存取五年后的本息是:" + year5);
}
}