Practice

Boundary Grade Classifier

EASYSelection5 marks

Read a mark from 0 to 100 and output the grade.

Use these boundaries:

  • 90 to 100: A*
  • 80 to 89: A
  • 70 to 79: B
  • 60 to 69: C
  • 50 to 59: D
  • 0 to 49: U

If the mark is outside 0 to 100, output Invalid.

Input: One integer mark. Output: The grade or Invalid.

Example:

Input:  89
Output: A
Premium is coming soon. All grading features are currently unlocked.

Sample Test Cases

Test 1: Upper A boundary
Inputs: 89
Expected: A
Test 2: A* boundary
Inputs: 90
Expected: A*
Test 3: Just below D
Inputs: 49
Expected: U