WDV221 Intro Javascript

Lab Exam #2

Includes Math Operators, If Statements, Loops and Arrays


1. Write a run time For Loop that will display 1-5. Each number should be within a <p>.

2. Write a run time While Loop that will display 2-10. Each number should be within a <p>.

3. Fix the following loop. It should display 5 items.

4. Change the following loop to include the line number on each output.

5. Fix the last button to work like the others.

6. Finish the function for the High-Low game.

High Low Game


7. Create a function that will use the following form to add numbers and display a cumulative total.

Accumulate Numbers

Current Value:

Extra Credit Problems:

X1. Use the array classes[] and Javascript to complete the following drop down box.

X2. Modify the High Low game to use a random number between 1-10.

X3. Modify resetHighLowGame( ) to use a new random number.