JavaScript - Not As Easy Lab 2

wpe2.jpg (48151 bytes)

You are an intern at Tri Star Investing.   The WebMaster (me) wants to develop a web page that calculates this present value problem:  Given an average annual interest rate, how much money should an individual save each month to be worth a certain amount, in a certain number of years?  The WebMaster's idea (that's my idea) is that customers can use the page to enter in the years until retirement, the average annual interest expected, and their retirement amount goal.   The WebMaster (again, that's me) wants you to create a form that will validate each text box and display the result. 

It would also be very cool if when you opened this web page, a pop-up window (ie. a different web page) would open up and display an advertising message.

wpe1.jpg (17384 bytes)

Use the open() method to pop-up this other web page you have to define.  open() has 3 parameters (put each in double quotes and separate them with commas)  --

bullet

the window file name or the URL of the web page you want popped up;

bullet

the name for this object - which could really be anything.  It could be referenced by other parts of the program that way (but it won't in this case).

bullet

the window features of the page being popped up ... for example, "height=220, width=400"

The close button should close the pop-up window when clicked ... use the appropriate event handler to invoke the window.close() method.  Also, define the "Our Web Site" link to point to the CSc420 web page (you should know this URL by now.)

OK, so what's the formula?

montly investment = goal * rate / (1- (1/ (1 + rate)^deposits))

Note, this formula WILL NOT WORK if you type it in exactly as I've typed it above (you should think a little, right?)

Click HERE to download the Tri Star Investments logo.
Click HERE to download the coinbag .jpg file.
Click HERE to download the stack of coins .jpg file

Good Luck - this lab is optional - it's due on the last day of classesIt will not be accepted late under any conditions whatsoever.   If it does not work, don't even bother FTPing it to me.  No credit will be give for a broken lab. However, I'm certain that if you work on it, it will be a great way to study for the JavaScript portion of the final, and will give you the confidence to add JavaScript to your resume.

Designed & created by DrB on Friday, July 30, 2004