Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Create a data file data/studentList.js . Create a global array called studentList and populate it with 5 example students, each array element having an

1. Create a data file data/studentList.js . Create a global array called studentList and populate it with 5 example students, each array element having an object for the students data, containing:

{ name: "student name goes here", sid: 12345678, wam: 64.5

}

Create a function called displayStudentTable(). The purpose of this function is to create a TABLE element, with 3 columns: SID, Name, WAM (as a header row). You are then to add a new row element for every student in studentList, and to fill each column (TD) as appropriate.

Create a 4th column Grade. This column is not stored in the studentList data, but is auto-calculated based on the WAM. You will write text in this column: Fail, Pass, Credit, Distinction, High Distinction, based on each students WAM score.

Depending on the grade of the user, assign a background colour for the entire row of red if the student is failing, otherwise green.

Create one final row, with only the WAM field having data, the rest being empty. Make this field the average value of all students WAM scores. Note: to calculate the average, simply keep a sum of all WAM scores (start the sum at 0, and add to it for each student), then at the end, divide this sum by the number of students (the length of the studentList).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2000 Database Design

Authors: Louis Davidson

1st Edition

1861004761, 978-1861004765

More Books

Students also viewed these Databases questions

Question

What is external fragmentation in a system with contiguous files?

Answered: 1 week ago

Question

What did they do? What did they say?

Answered: 1 week ago

Question

2. Do you find change a. invigorating? b. stressful? _______

Answered: 1 week ago