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

Learning Plan 5 5.2 Assignment 1

# 5.2 Assignment 1

#### File: /Learning Plan 5/5.2assignment1.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 5/jsFiles/5.1assignment1.js"
4. Locate the function named "assignment52_1Part1()".
5. Add code after the line: `// PART 1: YOUR CODE STARTS AFTER THIS LINE:` to complete the exercise.

### Part 2 Problem Statement

> Write a program that asks a user to enter a number. Add the entered number to the total, display the entered number and the total. Keep asking the user to enter numbers. Add each entered number to the total, display the entered number and the total until the total is greater than 1000. Then output the total on a separate line.

- Sample Part 1 Output:

    Entered Number: 123, Current Total: 123
    Entered Number: 234, Current Total: 357
    Entered Number: 345, Current Total: 702
    Entered Number: 456, Current Total: 1158

    The final total is: 1158

### Part 1 Program Planning Lists

- In the following pre tag, write the three planning lists based on the verbs and nouns you see in the problem statement.

    The List of Input Variables:

    The List of Output Variables:

    The Process Checklist:

### Part 1 Test Plan

    TEST PLAN:

    Test Case 1:
        Inputs:

        Expected Results:

    Test Case 2:
        Inputs:

        Expected Results:

### Your Part 1 Output:

## Part 2

1. Locate the function named "assignment52_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 even numbers. As long as they enter an even number, display the number with a phrase that says, " is an even number". When the user enters a odd number, output the number with the phrase, " isn't an even number" and end the program.

- Sample Part 2 Output:

    2 is an even number
    4 is an even number
    5 isn't an even number

### Part 2 Program Planning Lists

- In the following pre tag, write the three planning lists based on the verbs and nouns you see in the problem statement.

    The List of Input Variables:

    The List of Output Variables:

    The Process Checklist:

### Part 2 Test Plan

    TEST PLAN:

    Test Case 1:
        Inputs:

        Expected Results:

    Test Case 2:
        Inputs:

        Expected Results:

    Test Case 3:
        Inputs:

        Expected Results:

### Your Part 2 Output:

### Submitting your work

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