Mon Oct 26 16:17:00 EDT 2015

These are the simple Javascript programs. If you read them and (much better) play with variations, it will help you to figure out what's going on in programming, and the two Javascript labs will be easier too.

All of these programs work, but some give strange behavior if you give erroneous input (e.g. numbers instead of letters or vice versa) and some don't have a natural exit point. So, if you want to exit, you will have to close the pop-up window asking for another input or to hit the cancel button.

If you get into an infinite loop and check the box in the pop up window that says "Prevent this page from creating additional dialogs", you will need to open a new tab to run further Javascript programs.

add2.html: add two numbers

addup.html: add up numbers until 0

area.html: computes area of circle from radius

for.html: Foxtrot for loop

max.html: find maximum numeric value

name.html: echo a name

name2.html: concatenate two names

ring.html: computes area of ring with function

sign.html: computes sign of number

sort.html: sort a set of names

while.html: computes i, i^2 in a while loop