Here is the skeleton code: Total Points: 500 Student Name Course Grade 1) genera
ID: 3803914 • Letter: H
Question
Here is the skeleton code:
Total Points: 500 Student Name Course Grade 1) generateGrades0 will, for each student of the 'studentNames' array, populate the already declared global array 'grades', with random grades from 1-100, each value rounded to two decimal places HINT: a random number can be easily created with the built-in function Math.random0 this returns a pseudo-random real number from [0,11 a good way to create a random number within a range is to multiply the result of random0 by the desired upper bound and then add the lower bound e.g. try (Math. random 5) 1) to Fixed (2) and see which numbers you get LAST BUT NOT LEAST Make sure you insert NUMBERS into the array. Might save you a headache or two. 2) Once all the grades are in the array, populateStudents Table0 will generate the elements in the page. Each index in "grades', corresponds to the student with the same index of the 'studentNames' array; for example, grades[0] is the grade for student studentNames[0]. By the time the document is fully loaded, the table students' must be completely populated with all the students from the aforementioned array and its newly generated grades. Every even-number ce must be of the 'studentNameEven' class e.g. class this will need to be generated with code, can't be done manually HINT: For creating the HTML, you will need the following functions: var el document createElement return a new HTML element and stores it in el el.setAttribute ('attribute-name', 'attribute-value"), adds attribute to the HTML el el appendChild(el2), adds the HTML element to the el hierarchy e.g. table tr Il tr is a child of table
Explanation / Answer
Answer 1)
for (i = 0; i < studentNames.length; i++) {
grade[i] = ((Math.random()*100)+1).toFixed(2);
}