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

Learning Plan 5 5.1 Lab 4

# 5.1 Lab 4

#### File: /Learning Plan 5/5.1lab4.html

### Student

- Name:
- Section:
- Email:

### Lab Steps

1. Open this file in Firefox and Microsoft Visual Studio
2. Add your name, section, and email
3. Open the file /Learning Plan 5/5.1lab4.js in Microsoft Visual Studio
4. Create a JavaScript program that asks a user to enter something five times.
5. Variable declarations section
   1. Write a comment that identifies this coding section.
   2. Declare a `counter` variable.
   3. Declare a variable to hold the string from the user.
6. Loop Section
   1. Write a comment that identifies this coding section.
   2. Use a `for` loop and the counter variable.
   3. In the `for` loop assignment section, assign zero (0) to the counter variable.
   4. In the `for` loop boolean expression test if the loop counter is less than 5.
   5. In the `for` loop increment section, add one to the counter variable with a unary operator.
   6. In the loop you should:
      1. Prompt the user for an entry and assign it to the string variable.
      2. Display what the user entered on the page.

### Example Output

    You entered: Hi,
    You entered: looping
    You entered: is
    You entered: still
    You entered: cool.

### Your Output: