Question: In JAVASCRIPT Create an array of 5 Each inner array should contain a name and a numerical grade between 1 and 100 Create a function

In JAVASCRIPT

  • Create an array of 5
  • 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 and their respective values from F to A
  • Create a for loop that iterates through the length of the students' array and increment 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
    • In JAVASCRIPT Create an array of 5 Each inner array should contain
    • this is what I have, but its not working
    • function getGrade(value) {

      var david = [80];

      var victor = [77];

      var tracey = [55];

      var jason = [95];

      var raymond = [69];

      if (value >=100 && value

      return 'A.';

      } else if (value >=89 && value

      return 'B';

      } else if (value >=70 && value

      return 'C';

      } else if (value >=60 && value

      return 'D';

      } else if (value

      return 'F';

      }

      {

      document.write(i + "David's number grade is " + david + " and letter grade is " + [i] + ' ');

      document.write(i + "Victor's number grade is " + victor + " and letter grade is " + [i] + ' ');

      document.write(i + "Tracey's number grade is " + tracey + " and letter grade is " + [i] + ' ');

      document.write(i + "Jason's number grade is " + jason + " and letter grade is " + [i] + ' ');

      document.write(i + "Raymond's number grade is " + raymond + " and letter grade is " + [i] + ' ');

      }

      }

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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!