CPNT-262 Achievement 5 - Groundhog Day (loops)

  • Due: Friday, Feb 18 @ 11:59pm
  • Weight: 5% of the final mark

Learning Outcomes

This achievement will be marked out of 5 points where you will:

  • 1 point: Declare an empty output variable and incrementally build a string using the addition assignment (+=) operator.
  • 2 points: Loop through an array of items using a loop of your choice.
  • 1 point: Assign a finished output string to an HTML element using Element.innerHTML or Node.textContent.
  • 1 point: Document this activity in a Code Journal section of the project README (see last step in the Instructions).

Instructions

  1. Find or create an array of items of your choice. See this Gist for examples.
  2. Declare an empty string variable called output or similar.
  3. Loop through each item of the array using a loop statement of your choice (i.e. for loop or Array.forEach() method).
  4. Using the loop and the addition assignment (+=) operator, add each item to the output variable. You must change the item in some way, such as:
    • add HTML to create a numbered or bulleted list;
    • capitalize each word;
    • build links to other websites;
    • etc.
  5. At the end of the loop, assign the value of the output variable to a page element of your choice.
  6. Include a README.md file with the following information:
    • Your name, course and assignment title;
    • Attributions: Did anyone help you? Give credit to any classmates, articles, tutorials, etc that helped you complete this project.
    • Journal: Include self-assessments, observations, research, etc under the heading "Code Journal".

Points will be deducted for code that is too similar to examples shown in class or is uncommented.


Submission

  1. Create a GitHub repo of your project;
  2. Download a ZIP of the project;
  3. In Brightspace, submit your ZIP and include the following as a comment in your submission:
    • a link to your GitHub repo;
    • a link to the GitHub Pages site;