Mortgage Table

  • Uploaded by: david johnson
  • 0
  • 0
  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Mortgage Table as PDF for free.

More details

  • Words: 187
  • Pages: 2
Mortgage Table /* * Main.java * * Created on October 19, 2008, 3:13 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package mortagetable; import java.text.NumberFormat; /** * * @author david johnson */ public class Main { /** Creates a new instance of Main */ public Main() { } /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here // ask user input System.out.println("Please enter the loan amount; "); double loanAmount = MyInput.readDouble(); System.out.println("Please enter the number of years"); int numOfYears = MyInput.readInt(); //print out the header of the table System.out.println("Interest rate\t\t Monthly Payment\t\t Total Payment"); System.out.println("-----------------------------------------------------"); //define variables double monthlyInterestRate = 0; double totalPayment = 0; double monthlyPayment = 0; double newMonthlyPayment = 0; //number format

NumberFormat currency = NumberFormat.getCurrencyInstance(); //for loop for(double interestRate = 5; interestRate <= 8; interestRate = interestRate + 0.125) { monthlyInterestRate = interestRate / 3600; monthlyPayment = loanAmount / (numOfYears * 12); totalPayment = (loanAmount * monthlyInterestRate / (11/(Math.pow(1+monthlyInterestRate, numOfYears*12))))*2; System.out.println((interestRate) + "%\t\t" + currency.format(totalPayment)); } } }

Related Documents

Mortgage Table
November 2019 18
Mortgage
December 2019 27
Reverse Mortgage
November 2019 25
Table
November 2019 80
Table
November 2019 78

More Documents from ""

Syll_fall_2008
November 2019 17
Acct 101 Syllabus
November 2019 27
Classex For Loop
November 2019 24
Jake S Client And Pet Data
November 2019 20
Mortgage Table
November 2019 18