These are simple Javascript programs, most shown in class. 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.
These programs have been handed down through the years, and I did
not check them carefully. There may be bugs and/or
features, so if something seems really wrong, let me
know. Thanks.
A. LaPAUGH
add2.html: add two numbers
addup.html: add up numbers until 0
area.html: computes area of circle from radius
areafcn.html: computes area of circle with function
firstname.html: computes first name alphabetically
max.html: find maximum numeric value
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
loop.html: infinite loop: careful! If you run this you will have to "force quit" your browser!
for.html: Foxtrot for loop