Computer Science Homework Solutions
Problem
#38825

Calculator

Looking for mortgage program to display 3 mortgage loans: 7 year at 5.35%, 15 year at 5.5 %, and 30 year at 5.75%.  Use an array for the different loans Display the mortgage payment amount for each loan.  Non-graphical user interface.  Insert comments in the program to document the program.
Build on this if possible using an array:


import java.math.*;
import java.text.*;


//class BuyaHomeCalculator

class BuyaHomeCalculator {
     public static void main(String arguments[]) {


//Program Variables
    double term = 360;            
    double interestRate = 0.0575;
    double loan = 200000;        
    double monthlyRate = (interestRate/12);


//Discount factor calculator
    double discountFactor = (Math.pow((1 + monthlyRate), term) -1) / (monthlyRate * Math.pow((1 + monthlyRate), term));
    double payment = loan / discountFactor;

DecimalFormat df = new DecimalFormat("$###,###.00");
          

//Output
    System.out.println("The Loan amount is: $200,000");
    System.out.println("The intrest rate is: 5.75%");
    System.out.println("The term of the loan is: 30 years.");
    System.out.println("Monthly Payment Amount: " + df.format(payment) );


}
}

Attached file(s):
Attachments
BuyaHomeCalculator.java  View File
Solution
What is this?
By OTA - Overall OTA Rating
Maddu Shankar, MSc - 4.6/5
Purchase Cost Now
$2.19 CAD (was ~$11.97)
Included in Download
  • Plain text response
  • Attached file(s):
    • BuyaHomeCalculator.java
$2.19 Instant Download
Add to Cart
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
  • Week four mortgage calculator program using Java JDK 1.5.0 - Is this a correct compilation for this program modification? I also need comments throughout the code aswell. The code below should Modify the mortgage program to display 3 mortgage loans: 7 year at 5 ...
  • Java - Change Request #2 Requestor: Dwain Hammer - Billings, MT Write the program in Java (without a graphical user interface) and have it calculate the payment amount for 3 mortgage loans: - 7 year at ...
  • Flow control using n! and e^x for iteration - ((The following is exactly how the problem is presented)) import java.util.Scanner; import java.text.DecimalFormat; /** Iteratively computes e^x for a given value x, outputing values at iter ...
  • I keep getting errors when compiling this program in Java Netbeans Why? - The mortgage calculator must display the mortgage payment amount given the amount of the mortgage, the term of the mortgage, and the interest rate of the mortgage. This program must have hard code amo ...
  • Mortgage Calculator Modification - Modify the mortgage program to display 3 mortgage loans: 7 year at 5.35%, 15 year at 5.5 %, and 30 year at 5.75%. Use an array for the different loans. Display the mortgage payment amount for each lo ...
Browse