Preview

Gui Mortgage Calculator - Basic

Satisfactory Essays
Open Document
Open Document
469 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Gui Mortgage Calculator - Basic
/* * Author: * Class: * File Name: * Assignment: * * This program allows a user to calculate a mortgage payment based on their input. * The input consists of the loan amount, length of the loan, and the interest rate. */

import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.text.*; import java.io.*;

// Sets the Mortgage1 class which allows a user to calculate a mortgage loan

public class Mortgage1 extends JFrame { // Creates the buttons that will be used private JButton calcButton = new JButton("Calculate"); private JButton resetButton = new JButton("Reset"); // Creates the labels for the fields to be used private final JLabel amountLabel = new JLabel("Loan Amount:"); private final JLabel termLabel = new JLabel("Term (in years):"); private final JLabel rateLabel = new JLabel("Rate (actual %):"); private final JLabel mpayLabel = new JLabel("Monthly Payment:"); // Creates the text fields for the user input private JTextField amountField; private JTextField termField; private JTextField rateField; private JTextField mpayField; // Adds the title to the window and defines window diminsions public Mortgage1() { super("PRG/421 Mortgage Calculator"); initComponents(); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setSize(275, 175); setVisible(true); setResizable(false); setLocationRelativeTo(null); MenuBar mnuBar = new MenuBar(); setMenuBar(mnuBar); Menu mnuFile = new Menu("File", true); mnuBar.add(mnuFile); MenuItem mnuFileExit = new MenuItem("Exit"); mnuFile.add(mnuFileExit); Menu mnuHelp = new Menu("Help", true); mnuBar.add(mnuHelp); MenuItem mnuAbout = new MenuItem("About"); mnuHelp.add(mnuAbout); mnuFileExit.addActionListener(new ExitMenuHandler()); //mnuFileExit.setActionCommand("Exit");

}

// Creates the actual buttons and fields in a usable way public void initComponents() {

You May Also Find These Documents Helpful

  • Good Essays

    38. Calculating Loan Payments. You need a 30-years, fixed-rate mortgage to buy a new home for $250,000. Your mortgage bank will lend you the money at a 6.8 percent APR for this 360-month loan. However, you can only afford monthly payments of $1,200, so you offer to pay off any remaining loan balance at the end of the loan in the form of single balloon payment. How large will this balloon payment have to be for you to keep your monthly payments at $1,200?…

    • 441 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    A bank invests a $10 million, six-year fixed-rate business loan by selling one-year certificate of deposit.…

    • 367 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Hrm/531 Final Exam Paper

    • 807 Words
    • 4 Pages

    (a) Compute the monthly payment using the PMT function in Excel and then prepare an amortization table. Fully amortize the loan by going out to the last payment.…

    • 807 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Leoni Co. receives $240,000 when it issues a $240,000, 10%, mortgage note payable to finance the construction of a building at December 31, 2011. The terms provide for semiannual installment payments of $20,000 on June 30 and December 31…

    • 677 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    7. The program will calculate and display a final total for the items that are purchased.…

    • 498 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Mathl 104 Research Paper

    • 428 Words
    • 2 Pages

    Technology is pervading all levels of mathematics teaching and learning in our modern world, bringing ever more sharply into focus the change from traditional pencil and paper learning to a mixture of calculator, computer and pencil and paper learning environments. Currently the loan has 25 years remaining. Therefore to find out the P&I payment, you would plug in 300 for N (25x12), 5.75% for I, 0 for FV, and $112,242.47 for PV, and then press PMT which gives you the $706.12. However, we want to find out how much more money they have to pay to pay off the loan in 20 years instead of 25. Therefore change N to 240 (20x12) instead of 300. Then press PMT and we should get $788.04. Next, subtract the P&I payment they are making now (706.12) from $788.04, which tells you they need to pay $81.92 extra towards the principal each month to have the loan paid off in 20 years instead of 25.…

    • 428 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Hrm 531 Week 2 Assignment

    • 667 Words
    • 3 Pages

    response.append( " Term of Mortgage Loan: " + ( mortgageTerm * 12 ) + " months\n" );…

    • 667 Words
    • 3 Pages
    Powerful Essays
  • Good Essays

    Case95QuestionsPalmer1

    • 2198 Words
    • 9 Pages

    information. Explain the inputs into 1) the net initial investment outlay at year 0, 2) the…

    • 2198 Words
    • 9 Pages
    Good Essays
  • Powerful Essays

    Finance Unit 3 Questions

    • 1175 Words
    • 5 Pages

    Estimate the affordable monthly mortgage payment, the affordable mortgage amount, and the affordable home purchase price for the following situation (see Exhibit 9-8):…

    • 1175 Words
    • 5 Pages
    Powerful Essays
  • Powerful Essays

    The going interest rate per year = 10%, the number of years, N = 20, future value, FV = 1,000, and present value, PV = 865.…

    • 1735 Words
    • 7 Pages
    Powerful Essays
  • Satisfactory Essays

    Course Project

    • 271 Words
    • 12 Pages

    Weighted-Average Accumulated Expenditures X Interest Rate = Avoidable Interest $2,000,000 12% $240,000 1,800,000 10.38% 186,840 $3,800,000 $426,840 Weighted-average interest rate computation Principal Interest 10% short-term loan $1,600,000 $160,000 11% long-term loan 1,000,000 110,000 $2,600,000 $270,000…

    • 271 Words
    • 12 Pages
    Satisfactory Essays
  • Powerful Essays

    Interest is stated in terms of a percentage rate to be applied to the face value of the loan.…

    • 8283 Words
    • 49 Pages
    Powerful Essays
  • Satisfactory Essays

    /*Class. Project 1*/ import java.io. BufferedReader; import java.io. FileReader; import java.util. StringTokenizer; import java.io.…

    • 779 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Red Flags

    • 292 Words
    • 2 Pages

    In your examination of the financial statements, you see that there is a bank loan on the books. The average balance of the loan is $14,000 at the beginning of the prior year, and $10,000 at the end of the prior year. The interest expense on the income statement for the year is $1,560.…

    • 292 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    * Interest Rate- The interest is paid by borrowers for the use of money they borrow from a loan lender.…

    • 284 Words
    • 2 Pages
    Satisfactory Essays