Mortgage Payment Calculator - McMaster University

Assignment Number 4

SE4D04

The Design of the Computer-User Interface

Page 1 of 7

Set:19Oct06

Poehlman/2006-2007

Due:08Nov06@16:00

"Mortgage Payment Calculator"

DESIGN A program, which can be downloaded in source form with this assignment) has been created in a VB8 form ( V2), that replicates the illustration (Figure 1) at the right, upon first execution. Briefly, the user inputs the amount of money borrowed and the applicable interest rate in separate text boxes, suitably labeled for this purpose, as well as the payment schedule (once or twice monthly), and the duration of the loan, whereupon the calculator will output the payment($) required per the pay period.

COMPONENTS (As given in Figure 2.) -

'include Text Boxes, Command Buttons,

Option (Radio) Buttons, Check Buttons, and

uses built-in Financial functions. (See last

page of assignment.)

? A single form (default colour and shape)

which is sized to about 75% of the total

vertical available screen space and its

title bar contains "Assignment #, student

name and Id";

? Two Command Buttons captioned as

follows:

1. Calculate 2. Close ? Four TextBoxes:

Figure 1: The first screen that appears upon program execution. All buttons and user input boxes are active.

1. User input for an integer amount of

dollars representing the amount borrowed (loan amount) labeled as "Amount Borrowed";

2. User input box for an integer representing the expected interest rate (in percentage);

3. Two text output boxes used by the program to provide the Payment($) per pay period

(selected via checkboxes (see below)) either monthly or twice monthly, and the total

amount of interest paid for the duration of the loan period;

? One set (i.e. a panel as a container) of intrinsic (only one can be user set) radio buttons which

exhibit automatically mutually exclusive selection (i.e. only one button can be selected,

removing another set button if one is already selected) representing the amortization period

in integer years for explicit values of 15, 20, 25 & 30 years; and

? One set of checkboxes that must be manually programmed to behave mutually exclusively

upon selection (as do the radio buttons where only one can be set), involving either twice

monthly payment "bi-monthly" or once monthly "monthly" payments.

File:ass0406.pdf Date:18oct06/wfsp

Assignment Number 4

SE4D04

The Design of the Computer-User Interface

Page 2 of 7

Set:19Oct06

Poehlman/2006-2007

Due:08Nov06@16:00

FUNCTIONALITY -

? Events:

1. On form load (or

program execution run

from *.exe file when

compiled) all

components display as

shown in Figure 1. If the

user selects Close, the

program performs a

normal stop and returns

to the operating system.

2. If the user selects

Calculate, (if inputs are

properly assignment

values (see below)) the

program calculates, by

using the built-in

financial functions Pmt

and Ipmt.

The amount payable

each period and

The total interest

payable over the

lifetime of the

mortage.

3. Upon output of the

"Payment/Period" and "Total Interest($)" values in the textboxes (sutitably formatted as

Figure 2: This is the appearance of VB8 solution to the assignment at design time, showing the two command buttons, the four textboxes, the four radio buttons and two checkboxes, and their accompanying labels.

currency before display-

ing in the relevant textboxes),

the program determines which payment schedule

has been selected and changes the label on the "Payment($)/Period" to either

"Payment($)/2xMnthly" or "Payment($)/Mnthly".

This behaviour is illustrated in Figure 3.

File:ass0406.pdf Date:18oct06/wfsp

Assignment Number 4

SE4D04

The Design of the Computer-User Interface

Page 3 of 7

Set:19Oct06

Poehlman/2006-2007

Due:08Nov06@16:00

? Error Conditions:

1. The program must check that the input to these text boxes is numeric, if not, an error is displayed in a message box. A group of Option (Radio) Buttons allows selection of amortization period as 15, 20, 25,30 years. Use a default value of 20 years. Mortgage payment is made either monthly or twice a month '(Not bi-weekly) at the beginning of the period. This is selected by a pair of Check Buttons. Selection of one of these buttons must deselect the other (which needs to be explicitly implemented in the code). If both check buttons are unchecked, a message box displays error, as shown in Figure 4.

2. The program should also detect when the two input text boxes (labelled "Amount Borrowed($)" or "Annual Rate of Interest(%)" ) contain either nothing (are null), or contain non-numeric characters, which is illustrated in Figure 5.

3. NOTE: it is possible upon first screen execution to not have one radio button selected. This is an unhandled exception which should be handled in any manner you feel is appropriate.

(a

(b

Figure 3: (a) If the inputs are acceptable (i.e. they are not empty, contain integers, etc (see text) to the program, when the Calculate button is pressed, (b) both "Payment($)/Period" and "Total Interest ($)" are calculated and placed into the appropriate textbox. Also, the "Payment($)/Period" is changed to either "Payment($)/2xMnthly" or "Payment($)/Mnthly", depending on which "Payment Schedule" "is selected by the user: Bimonthly or Monthly, respectively.

File:ass0406.pdf Date:18oct06/wfsp

Assignment Number 4

SE4D04

The Design of the Computer-User Interface

Page 4 of 7

Set:19Oct06

Poehlman/2006-2007

Due:08Nov06@16:00

(a)

(b)

(c)

(d)

Figure 4: (a) If the "Calculate" button is clicked and NO Payment Schedule is selected, then a program pops up a modal window which must be acknowledged by the user (OK pressed), (b) when this is done, the program rewrites the "Payment($) / Mnthly" (or whatever) label back to "Payment($) / Period"; (c) If the "Calculate" button is clicked and TWO Payment Schedules are selected, then a program pops up a modal window which must be acknowledged by the user (OK pressed), (d) When user inputs a "Payment Schedule" via checkbox & presses calculate, the behaviour is as in step 3 above, under Events heading.

File:ass0406.pdf Date:18oct06/wfsp

Assignment Number 4

SE4D04

The Design of the Computer-User Interface

Page 5 of 7

Set:19Oct06

Poehlman/2006-2007

Due:08Nov06@16:00

(b)

(a)

Figure 5: (a) If either or both of the two input

textboxes (Amount Borrowed($) or

(Annual Rate of Interest(%)) contain

null or non-numeric characters), the

program will popup a modal error

window, as illustrated (a) and (b);

while, in (c) the null "Payment

Schedule" brings out the usual error

notification window as mentioned

before, AFTER the detection and

popup indicating non-numerical or null

(c)

entries in either or both of the Amount

Borrowed($) or Annual Rate of

Interest(%) labeled textboxes, as put in

by the user, and its subsequent

dismissal (i.e. user selects OK in the

popup as in either (a) or (b)).

In MS visual studio, the amortization payment schedule algorithm is an intrinsic (internal) function as outlined below.

File:ass0406.pdf Date:18oct06/wfsp

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download