Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

JavaScript Open your main.js file. Create an array of 5 arrays. Each inner array should contain a name and a numerical grade between 1 and 100. Create a function called getGrade with a parameter of...

1 answer below »

JavaScript

  • Open yourmain.jsfile.
  • Create an array of 5 arrays.
  • Each inner array should contain a name and a numerical grade between 1 and 100.
  • Create a function called getGrade with a parameter of grade.
    • Inside the above function, create an if/else statement that accounts for grades and their respective values from F to A.
  • Create a for loop that iterates through the length of the students' array and increments by 1 with each loop.
    • Inside that for loop, use document.write(//your statement); to output a string of text that reads like the following example:
    • David's number grade is 80 and letter grade is a B.

If you'd like, copy/paste the following comments into yourmain.jsfile to help you complete each of the above tasks.

//create an array 5 arrays
//each inner array should contain a name and a number grade
//create a function called getGrade with a parameter of value

//inside the function, create an if/else statement that accounts for grades and values from F to A
//create a for loop that iterates through the length of the students array and increments by 1 with each loop

//inside the for loop, use document.write to output a string of text that reads like the following example:
//David's number grade is 80 and letter grade is a B

Your final output should look like this...

Lesson 7 Project

David's number grade is 80 and letter grade is a B
Victor's number grade is 77 and letter grade is a C
Tracey's number grade is 55 and letter grade is a F
Jason's number grade is 95 and letter grade is a A
Raymond's number grade is 69 and letter grade is a D

Answered 4 days After Jul 02, 2021

Solution

Arun Shankar answered on Jul 07 2021
148 Votes
let grades = [['David', 80], ['Victor', 77], ['Tracey', 55],
['Jason', 95], ['Raymond', 69]];

function getGrade(numericalGrade)
{
if(numericalGrade >= 90)
return 'A';
else if(numericalGrade >= 80)
return 'B';
else if(numericalGrade >= 70)
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here