[text] table

Viewer

  1. private static void produceTable() {
  2.             System.out.println("# Months   Monthly Payment");
  3.             System.out.println("--------   ---------------");
  4.  
  5.       double intRatePerMonth = (I/100)/12;
  6.       double numerator = A * intRatePerMonth;
  7.  
  8.       for (int n = minD; n <= maxD; n++) {
  9.          double denominator = 1 - Math.pow(1+intRatePerMonth, -n);
  10.          double monthlyPayment =  numerator / denominator;
  11.          System.out.printf("%5d        $%8.2f", 
  12.                            n, monthlyPayment);
  13.       }
  14.    }

Editor

You can edit this paste and save as new:


File Description
  • table
  • Paste Code
  • 01 Mar-2021
  • 542 Bytes
You can Share it: