Preview

Gui Mortgage Calculator Case Study

Powerful Essays
Open Document
Open Document
763 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Gui Mortgage Calculator Case Study
GUI Mortgage Calculator
University of Phoenix
David Silberberg
POS 407
04-19-2005

Program

/* * MortgageGui.java * Version 4 * Created on April 19, 2005 * Use a graphical interface to allow a user to input a principle amount, interest rate * and term of loan then calculate loan payment. * Added text field to show amortization of loan. Also checked for last payment equal to * less than monthly payment. Added in the ability to select a predefined interest rate * and term. Added in the ability to read in from a file (file is found in C:\mortgagein.txt). * * * @author ************ */ import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.text.NumberFormat; import java.text.DecimalFormat;
…show more content…
row4.add(mthPay); mthPay.setEditable(false); pane.add(row4); FlowLayout layout5 = new FlowLayout(FlowLayout.CENTER, 2, 2); row5.setLayout(layout5); row5.add(Calculate); row5.add(Reset); row5.add(Quit); pane.add(row5); FlowLayout layout6 = new FlowLayout(FlowLayout.CENTER, 2, 2); row6.setLayout(layout6); row6.add(header); row6.add(scroll); mortg.setEditable(false); pane.add(row6);

setVisible(true);
}

public void actionPerformed (ActionEvent evt){ Object source = evt.getSource(); choice = combo.getSelectedIndex(); if (source == Calculate){ //calculates mortgage when Calculate button is clicked switch (choice) { case 0: calculate(); break; case 1: years.setText("7"); irate.setText("5.35"); calculate(); break; case 2: years.setText("15"); irate.setText("5.50"); calculate(); break; case 3: years.setText("30"); irate.setText("5.75"); calculate();
…show more content…
case 4: readText(); calculate(); break; }

} else if (source == Reset){ //Resets values to a default value when pressed princ.setText("100000"); mthPay.setText(""); mortg.setText(""); years.setText(""); irate.setText(""); textFile.setText(""); total = 0;

} else if (source == Quit){ //exits program when quit button is pressed

You May Also Find These Documents Helpful

  • Good Essays

    Is3350 Unit 1 Assignment

    • 1123 Words
    • 5 Pages

    The amount of principal due on a formal written promise to pay. Loans from banks are included in this account.…

    • 1123 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    Unit 9 Assignment

    • 796 Words
    • 4 Pages

    To find payment amounts, you may use Excel, the EZ Calculators app, or the tables in the Chapter if those tables have the needed values. When finding an APR, give an exact value using Excel or the EZ Calculators app. Show work.…

    • 796 Words
    • 4 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

    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

    Math 533 Part C

    • 1123 Words
    • 5 Pages

    The credit balance is represented by the $ and the income is represented by the $1000s.…

    • 1123 Words
    • 5 Pages
    Powerful Essays
  • Good Essays

    Programing Problems

    • 721 Words
    • 3 Pages

    As Real Declare InterestRate As Real Declare NumberMonths As Real Declare MonthlyRate As Real Declare Payment As Real Display “Welcome to Payment Calcultor.” Call User Input Module…

    • 721 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Study Questions 4

    • 480 Words
    • 2 Pages

    the rate, for a payment period, multiplied by the number of payment periods in a year.…

    • 480 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    unit 3

    • 313 Words
    • 2 Pages

    9. Write a pseudocode statement that subtracts the variable Down Payment from the variable total and assigns the result to the variable due.…

    • 313 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    You can even create interactive programs that allow the user to input values for variables…

    • 5177 Words
    • 21 Pages
    Good Essays
  • Better Essays

    Ecology Final Review

    • 17348 Words
    • 70 Pages

    o The weight or mass of an element is equal to the number of protons and number of neutrons…

    • 17348 Words
    • 70 Pages
    Better Essays
  • Good Essays

    DATE formula to figure out how to fill in the Payment Date column. You may type in the Extra…

    • 1154 Words
    • 9 Pages
    Good Essays
  • Good Essays

    John’s theory of the case: The hospital was negligent in failing to maintain a safe and supervised environment in the emergency room waiting room where John was located, this failure to provide supervision is the reason he sustained his injury. Issue: Does St. Vincent’s Hospital owe John a duty of care? Rule: The majority of courts have found that premises owners have a duty to take reasonable precautions to protect their invitees from foreseeable 3rd party attacks.…

    • 911 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    Minesweeper

    • 300 Words
    • 2 Pages

    import java.awt. BorderLayout; import java.awt. GridLayout; import java.awt.event. InputEvent; import java.io. DataInputStream;…

    • 300 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Java Programming Questions

    • 1971 Words
    • 8 Pages

    Using switch and case statements write a program to add, subtract, multiply and divide the two numbers…

    • 1971 Words
    • 8 Pages
    Good Essays
  • Satisfactory Essays

    s.executeUpdate("UPDATE studentdetails SET stname= '"+jTextField2.getText()+"' , stage= '"+jTextField3.getText()+"', sttel= '"+jTextField4.getText()+"', stresult= '"+jTextField4.getText()+"' WHERE stid = '"+jTextField1.getText()+"' ");…

    • 2413 Words
    • 17 Pages
    Satisfactory Essays