CSCI-121 Lab #4 Observations

Things the lab submission should have included:

  1. A file named lab4.html.
  2. Appropriate title and H1.
  3. Table with proper caption and including 144 (12x12) cells.
  4. An id scheme (format) for TDs in the header row, another for the header column, and a third for each of the multiplication table products.
  5. Proper buttons below the table.
  6. A "Fill Headers" button that when clicked caused fillHeaders() function to be called.
  7. The fillHeaders() function that:
    1. Had a single for loop.
    2. Within the for loop calculated two different ID values, one for the header row, one for the header column.
    3. Used another function, getLabel() to get the label to place in header row, header column cell within the loop.
    4. Used document.getElementById() within the loop to set the header row, header column cell to the label.
  8. A "Fill Table" button that when clicked caused fillTable() function to be called.
  9. The fillTable() function that:
    1. Had a for loop within a for loop (outer loop for row, inner loop for column).
    2. Within the loop calculated the ID for addressing the multiplication product.
    3. Used document.getElementById() to get the TD and set its innerHTML to the product.
  10. Link for emailing grade back.

Things several seemed to get wrong and/or are having difficulty with:

  1. For loop concepts (the three statements, loop variable).
  2. Switch statement - it's syntax. You were warned it would be in the lab.
  3. String manipulation, especially concatenation: var str = "x" + 0;
  4. Use of IDs for "addressing" elements, use of document.getElementById() and related concepts.
  5. General reasons for using a function (re-use, break down a complex problem into smaller parts, etc).