Explore BrainMass

Explore BrainMass

    mortgage program to display 3 mortgage loans

    Not what you're looking for? Search our solutions OR ask your own Custom question.

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    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");

    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) );


    © BrainMass Inc. brainmass.com March 4, 2021, 6:17 pm ad1c9bdddf


    Solution Summary

    This job models a mortgage program to display 3 mortgage loans.