let students = [
{ name: 'Vivek', scores: [70, 90, 60, 91] },
{ name: 'Akshat', scores: [90, 80, 80, 60] },
{ name: 'Arnav', scores: [70, 60, 90, 90] },
];
//To calculate the grade obtained by the student look at below explanation.
// Average score greater than or equal to 91 -> A grade
// Average score greater than or equal to 81 -> B grade
// Average score greater than or equal to 71 -> C grade
// Average score greater than or equal to 61 -> D grade
// For other average scores -> E
- Task1 : Draw the Object Diagram for the given Array of Objects.
- Task2 : Write the code to print the name of the first student.
- Task3 : Write the code to print the length of the scores array for the first student.
- Task4 : Write the code to calculate the average score for the first student.(TIP: first create a variable which point to students[0].scores, then use it to calculate the average)
- Task5 : Write the code to calculate the grade for the first student and print out the name of the student followed by his grade.
- Task6 : Write the code to add the calculated grade for the first student as a property to the object.
- Task7 : Update the Object Diagram you created in Task1 with the grade property.