HTML and CSS Reference
To Create the monthlyPmt() Function
The following step enters the monthlyPmt() user-defined function to calculate the monthly payment on a
values in line 61 are
passed to monthlyPmt()
Click the beginning of
line 67 and press the
e n t e r key once.
rate converted to
Position the insertion
point on the blank
line 67 just created.
to number of
used to strip off
code shown in
Table 10-18 to write
the code to calculate
the monthly payment
and then press the
e n t e r key once
used in expression to
To Save an HTML File and Test a Web Page
Now that the monthly payment can be calculated, this is a good place to test the
Web page. You should not continue to the next section until this code is working properly.
The following steps save the HTML file and test the Web page.
With the USB drive plugged into the computer, click File on the menu bar, and then
Click the browser button on the taskbar.
Click the Refresh button next to the Address box.
Click the Reset button on the form.
If necessary, click the Sales Price text field to place the insertion point in the text field.
Type 174500 in the Sales Price text field and then press the t a b key.
Type 51000 in the Down Payment text field and then press the t a b key. If there are
no errors, the Loan Amount of 123500 is calculated and displays in the Loan Amount
Type 4.5 in the Interest Rate (e.g. 5.9) text field and then press the t a b key.
Select 30 in the Number of Years drop-down menu field and then click the Calculate
button (Figure 10-26 on the next page).
What if my result was slightly different? Did I do something wrong?
If your result is only a few cents different, it is probably just a difference in the math proces-
sor on your computer. If the value is hundreds or even thousands of dollars off, check your
formula code on lines 68 through 70.