1 条题解

  • 0
    @ 2025-9-10 8:56:47

    Java :

    import java.util.Scanner;
    public class Main {
    	public static void main(String[] args) {
    		Scanner n = new Scanner(System.in);
    		double amount = n.nextDouble();
    		int y = n.nextInt();
    		double yra = n.nextDouble();
    		double yrb = n.nextDouble();
    		System.out.println("Interest Rate" + "\t" + "Monthly Payment" + "\t"
    				+ "Total Payment");
    		for (double i = yra; i <= yrb; i += 1.0 / 8) {
    			double MP = (amount * i / 1200)
    					/ (1 - 1 / Math.pow(1 + i / 1200, y * 12));
    			double MP1 = (int) (MP * 100) / 100.0;
    			double TP = MP * 12 * y;
    			double TP1 = (int) (TP * 100) / 100.0;
    			System.out.println(i + "%\t\t" + MP1 + "\t\t" + TP1);
    		}
    	}
    }
    
    • 1

    4.21 财务应用程序:比较不同利率下的贷款

    信息

    ID
    3369
    时间
    1000ms
    内存
    128MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者