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

Learning Plan 5 5.3 Project - Part 3

# 5.3 Project - Part 3

#### File: /Learning Plan 5/5.3projectPart3.html

### Student

- Name:
- Section:
- Email:

### Specifications

- Open this file in Firefox and Microsoft Visual Studio.
- Add your name, section, and email.
- Open the file `jsFile/5.3projectPart3.js` in Microsoft Visual Studio.
- Your JavaScript code must go in the `jsFile/5.3projectPart3.js` file.
- Read the following problem statement and complete all steps in the development process.
- Make sure your JavaScript code conforms to the course coding standards.

### Problem Statement

> Write a program that reads the Student Exam Records. The program must output an HTML table, a table with a row for each student who had an exam score with a grade of "A". (An "A" is defined for this program as a score that is greater than or equal to 90.) The table will be preceded by an HTML header tag identifying the table.
> Following the table, two total lines must appear: one which gives the number of records found in the file that had "A" exam scores, and two, the total number of records found in the file.
> NOTE: The program must be written so that it doesn't know in advance how many students had an exam score of "A" nor can it know in advance who they are or their relative position within the record set. (If the program logic is written in this prohibited fashion, the Project is worth zero (0) points, and must be re-written and resubmitted.)

> The program must be broken up into reasonable functions, although no set number of functions is required. Suggested functions are documented in the following section. The controller (aka mainline) function project53Part3() already exists in the JavaScript file (the js library file.) You will need to create all the other functions.
> It may help you if, prior to programming, you consult the structure chart from class as a guide for the overall structure of this program. Also, see the example structure chart passed out in class for the 4.6 example regarding Gas Supply Billing.

#### Functions

1. `function project53Part3()`
   - The function will perform the following.
     1. Output an HTML header tag for the A Exam Records.
     2. Initialize the exam records by calling the initializeExamRecords() function.
     3. Call the startTable() function to begin the HTML table.
     4. Loop through the Student Exam Records. For each record with a score greater than or equal to 90, output the record by calling the printRecord() function. Note: The loop is located right in the controller module. This loop is a major feature of the program, and belongs right in the controller module.
     5. After the loop has finished, call the endTable() function to end the HTML Table.
     6. As the final activity, call the printTotals() function to place the totals beneath the table.
2. `function initializeExamRecords()`
   - This function will open the Student Exam Records.
3. `function startTable()`
   - This function will output a beginning HTML table tag and a table header row. The header row will contain two table header tags, one with the content, "Student Name", and other with, "Exam Score".
4. `function printRecord()`
   - This function will print one Student Exam Record. It must output a full HTML row with two table data tags. The first data tag will contain the student name and the second will contain the exam score.
5. `function endTable()`
   - This function will output an HTML table end tag.
6. `function printTotals()`
   - This function will print the totals beneath the table.

#### Variables

- The program will use global variables for the Student Exam Records record set, the fields in the record set, and counters.

### The Program Planning Lists

- In the following pre tag, write the three planning lists prior to doing any programming.

    The List of Input Variables:

    The List of Output Variables:

    The Process Checklist:

### The Test Plan

    TEST PLAN:

    Test Case:
        Inputs: The Exam Records file

        Expected Results:

         • manually search the file; write down here the names and scores for those records with A's

### Example Output

### A Exams

Student Name | Exam Score
--- | ---
Dan Bristol | 99
Brian Smith | 91
Nancy Hagman | 90
Seth Olson | 100

the two total lines will be here; they can be in the form of an HTML table if desired, but they do not have to be in the form of an HTML table

### 5. JavaScript Output

> Write the JavaScript code based on everything you've done. Your code must follow the course coding standards. You should add good comments about the different parts of your solution.

- 5.3 Project - Part 3 Output: