Conditionals

Conditionals
πŸ‘¨β€πŸ’Ό We're building a grade calculator for a school system. Based on a numeric score, we need to determine the letter grade.
🐨 Open
index.ts
. The starter sets score to 85.
  1. Create a grade string using an if/else if/else chain:
    • 90 and above: "A"
    • 80–89: "B"
    • 70–79: "C"
    • 60–69: "D"
    • Below 60: "F"
  2. Create passed as a boolean that is true when the letter grade is C or above (that means grades "A", "B", or "C")
  3. Export score, grade, and passed

Required exports

score, grade, passed

Completion criteria (with score = 85)

  • score remains 85
  • grade is "B"
  • passed is true
πŸ’° Check the highest ranges first so the first match wins.

Please set the playground first

Loading "Conditionals"
Loading "Conditionals"