How would you do the problem with pencil, paper, and a calculator? Probably something like
Answer = length width (1 + overage/100)
You will be doing that same calculation in JavaScript. Verify that overage is in range (else alert()) and is an integer, crunch the numbers, and display the answer.
That mortgage example was close to the first thing I ever did, being near the front of a primer I read a few years ago, so it can't be that hard to grasp. I've since added an option for number of months, a new PI popup window, and a "Last Modified" script, but that was originally copied verbatim from the book.
BTW, does this problem have a form or does it get its data from prompts?