In Class practice Review: Loan Calculator Program

Developed a console-based program for computing loans.

This section develops a GUI application for computing loan payments

 

The program computes loan payments and provides a graphical user interface.

Developing a GUI application involves designing the user interface and writing the code to process the events. Here are the major steps in writing the program:

  1. Design the user interface (UI) by drawing a sketch. The UI consists of labels, text entry boxes, and a button. You can use the grid manager to position them in the window.  WE will use MS Visio in class to replicated the Wire-frame Diagram attached below.  If you are doing this activity from a distance and do not have access to MS Visio, you may use MS Word Tables to simulate the grid layout.

  2. Process the event. When the button is clicked, the program invokes a callback function to obtain the user input for the interest rate, number of years, and loan amount from the text entries, computes the monthly and total payments, and displays the values in the labels.  We will review the code in the attached program to better understand building a GUI and implementing event driven programming in a GUI

Loan Calculator Wireframe.png Download Loan Calculator Wireframe.png

 

Download LoanCalculator.py

 

Process Flow of building the GUI

  1. create window
  2. create labels
  3. create entries
  4. create button
  5. callback
  6. computePayment
  7. set monthlyPayment
  8. set totalPayment
  9. getMonthlyPayment
  10. create GUI
  11. Process Flow of building the GUI
  12. create window
  13. create labels
  14. create entries
  15. create button
  16. callback
  17. computePayment
  18. set monthlyPayment
  19. set totalPayment
  20. getMonthlyPayment
  21. create GUI