HTML and CSS Reference

In-Depth Information

Cases and Places
continued

To calculate the GPA, divide the number of grade points by the total number of credit hours.

Display your GPA using an alert() function. As you verify the grades, you should convert the letter in

the text field to upper case to be consistent. In addition, you are only looking for letter grades of A+, A,

A-, and so on. Not every course needs a grade so you should not enter W, I, or P grades.

3
: Creating a Web page for a Real Estate Web site

Professional

You are an intern at the Shoreline State Bank. The bank has received numerous questions about the loan

calculator Web page. Customers want to be able to enter the sale price, a down payment percentage (not

a dollar value), and calculate the mortgage amount based on the down payment. In addition, they wish to

have the amount of Personal Mortgage Insurance (PMI) calculated and added to the form.

Create a separate function that validates Selling Price and Percent Down (for Down Payment)

text fields as valid numbers. Calculate the down payment by multiplying the down payment percentage

times the selling price and subtracting that value from the selling price. Use an onBlur event handler to

call this function after the percent down value is entered.
Hint:
Selling Price - (Selling Price * (Percent

Down/100)).

Use the original form from the chapter project, add the text field, and use the original event

handler to call the Calc() user-defined function. Add the calculation to test if the percent down is less

than 20% to calculate the PMI. The monthly PMI is calculated by taking the mortgage amount * .005

and dividing the product by 12 to get the monthly amount.