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

Learning Plan 5 Process Student Enrollments

# Example 3: Process Student Enrollments

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

### Problem Statement

> Write a program that will read a file of student records, and select and print only the records of those students enrolled in a course named Programming I. Each student record contains student number, name, address, zip code, gender, and course number. The course number for Programming I, is 18500. three totals are to be printed at the end of the report: total females enrolled in the course, total males enrolled in the course, and total students enrolled in the course.

### 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:
        record:
            studentNumber
            name
            address
            zipCode
            gender
            courseNumber

    The List of Output Variables:
        studentNumber
        name
        address
        zipCode
        gender
        courseNumber
        totalFemales
        totalMales
        totalStudents

    The Process Checklist:
        read student records
        select student records
        print selected records
        compute total females enrolled
        compute total males enrolled
        compute total students enrolled
        print totals

### The Test Plan

    VARIABLES:

    TEST CASE 1:

        INPUT VALUES: Record Set

        EXPECTED RESULT: First found record: 101	Joe Coyne

    TEST CASE 2:

        INPUT VALUES: Record Set

        EXPECTED RESULT: 102	Fred Hensen

    TEST CASE 3:

        INPUT VALUES: Record Set

        EXPECTED RESULT: 106	Greg Statz

### 5. JavaScript Output

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

- Here's the code:

- Here's the output: