Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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
    • image text in transcribed
    • 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

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

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Sham Navathe

4th Edition

0321122267, 978-0321122261

More Books

Students also viewed these Databases questions

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago