Ad

Create a function getGrade that takes three arguments: exam, projects,
and returns a grade based on the following conditions:

  • Return "A" if exam is greater than 90 or projects is greater than 10.
  • Return "B" if exam is greater than 75 and projects is at least 5.
  • Return "C" if exam is greater than 50 and projects is at least 2.
  • Otherwise, return "F".
function getGrade(exam, projects) {
  if (exam > 90 || projects > 10) {
    return "A";
  } else if (exam > 75 && projects >= 5) {
    return "B";
  } else if (exam > 50 && projects >= 2) {
    return "C";
  } else {
    return "F";
  }
}