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

Learning Plan 5 An Example From the Book

# Example 2: Print Examination Scores

#### File: /Learning Plan 5/example2.html

### Problem Statement

> Write a program to read and print a series of names and exam scores for students enrolled in a mathematics course. The class average is to be calculated and printed at the end of the report. Scores can range from 0 to 100. Read all scores from the Student Exam Records set.

### 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:
        studentName
        studentScore

    The List of Output Variables:
        studentName
        studentScore
        averageScore

    The Process Checklist:
        read student record
        print student record
        calculate average score
        print average score

### The Test Plan

> Create a test plan for the algorithm.

    VARIABLES: studentScore

    TEST CASE 1:

        INPUT VALUES: all records

        EXPECTED RESULT: average: 89

### 5. JavaScript Output

> Write the JavaScript code based on everything you've done.

- Here's the code:

- Here's the output: