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

    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

    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

    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

    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

    Programing Problems

    • 721 Words
    • 3 Pages

    Call Monthly Rate Module Call Payment Calculation Module Call Display module End Main Module User Input Module Display “Enter loan amount please.” Input LoanAmt Display “Enter interest rate please.” Input InterestRate Display “Enter number of monthly payments desired please.”…

    • 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
  • 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 Progamming

    • 7830 Words
    • 32 Pages

    Exercise CheckPassFail (if-else): Write a program called CheckPassFail which prints "PASS" if the int variable "mark" is more than or equal to 50; or prints "FAIL" otherwise.…

    • 7830 Words
    • 32 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
  • 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

    Sexy Time

    • 676 Words
    • 3 Pages

    using System; using System. Collections. Generic; using System. ComponentModel; using System. Data; using System.…

    • 676 Words
    • 3 Pages
    Satisfactory Essays