COP2500 Assignment 6

Deliverables: To complete this assignment you must --

  1. Edit this HTML and JavaScript page and demonstrate to the lab instructor that it operates correctly.
  2. If you do not finish in the lab, email your instructor showing what you have completed. You can get partial credit even if not fully completed with the lab.

Introduction: The goal of this assignment is to give you experience working with the scope of variables within programs.


Procedures:
  1. Use a text editor to edit this file as directed.
  2. Program 1 gives the wrong result due to scoping. The programmer attempted to make a program that added the average of several pairs of numbers.

    Edit the JavaScript contained in this file to fix the error.

  3. Program 2 gives the wrong result due to scoping. The programmer attempted to make a program that added a sequence of numbers (0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10) and repeats the addition 5 times.

    Edit the JavaScript contained in this file to fix the error.

  4. Open a browser and verify that the file displays properly. Keep this window open until the instructor has had time to verify your work. In order to obtain full credit for the lab you need to show your source code to your grader, and you need to show him that it is working in the lab.