Northcentral Technical College Introduction To Programming
10-152-310
Introduction to Programming with JavaScript NTC 10-152-310

Learning Plan 6 6.1 Assignment 1

# 6.1 Assignment 1

#### File: /Learning Plan 6/6.1assignment1.html

### Student

- Name:
- Section:
- Email:

## Part 1

1. Open this file in Firefox and Microsoft Visual Studio
2. Add your name, section, and email
3. Open the file "/Learning Plan 6/jsFiles/6.1assignment1.js"
4. Locate the function named "assignment61_1Part1()".
5. Add code after the line: `// PART 1: YOUR CODE STARTS AFTER THIS LINE:` to complete the exercise.
6. Lab Steps
   1. Write a program that gets strings from a user, creates an unordered list with the entries, and outputs the list to the page.
   2. In the assignment61_1Part1() function, start an unordered list element in a global variable. Loop and ask the user to entry a string or "quit" to stop. Call the following list element function and pass the entry to the function. When the user enters "quit", append the end tag of the list element to the global variable and output the entire list to the page in the output div.
   3. Create a function that creates an HTML list element and appends it to a global variable. The function will have one parameter that is the entry from the user. Generate a list element with the entry and append it to the global variable.

- Sample Part 1 Output:

- hi
- there
- Bye, bye.

### Your Part 1 Output:

## Part 2

1. Locate the function named "assignment61_1Part2()".
2. Add code after the line: `// PART 2: YOUR CODE STARTS AFTER THIS LINE:` to complete the exercise.

### Part 2 Problem Statement

> Write a program that asks a user to enter three numbers. If all three entries are numbers then output the sum of all combinations of pairs of numbers from the three entries. The code that performs the addition and outputs the result for each pair should be in a function and is called from the main function. Output the answers in an HTML table. The table and its end tag should be added to the HTML page. The table rows will be inserted with the program.

- Sample Part 2 Output:

Entry Pair | Sum
2 | 3 | 5
2 | 4 | 6
3 | 4 | 7

### Part 2 Program Planning Lists

- Add your planning lists to the JavaScript code.

### Part 2 Test Plan

- Add your test plan to the JavaScript code.

### Part 2 Algorithms

- Add your algorithms to each function.

### Your Part 2 Output:

### Submitting your work

- Zip and submit 6.1 Assignment 1
- Don't forget to also zip and submit your JavaScript file 6.1assignment1.js.
- Make sure that both files are zipped and submitted together.