Calculate a Grade Using Fixed Thresholds

Given an integer score from 0 through 100, return its grade using these fixed bands: A for 90–100, B for 80–89, C for 70–79, D for 60–69, and F for 0–59.…

Given an integer `score` from 0 through 100, return its grade using these fixed bands: A for 90–100, B for 80–89, C for 70–79, D for 60–69, and F for 0–59. Return exactly one uppercase letter. These thresholds belong to this exercise.

0 <= score <= 100. score is an integer. The grade bands are fixed and do not model an institution-specific policy.

Example 1: input score = 90; output A. 90 is included in the A band.

Example 2: input score = 89; output B. 89 is below 90 and at least 80.

Example 3: input score = 59; output F. 59 is below all passing thresholds.

Category: Math & Numbers. Topic: math. Difficulty: Easy. Patterns: math.