Challenge 1: A grade Function Using Guards — Possible Solution ==================================================================== Main.hs: grade :: Int -> String grade score | score >= 90 = "A" | score >= 80 = "B" | score >= 70 = "C" | otherwise = "F" main :: IO () main = do print (grade 95) print (grade 82) print (grade 71) print (grade 40) Output: "A" "B" "C" "F" Explanation: Guards are checked top to bottom, exactly like the chapter's own classify example -- each `| condition` is tried in order, and the first one that evaluates to True wins. A score of 82 fails the first guard (>= 90) but satisfies the second (>= 80), so "B" is returned without ever checking the remaining guards. otherwise is simply a guard that's always True, guaranteeing the function has a result for every possible Int rather than crashing on an unmatched case. WHY THIS WORKS AS AN ANSWER ------------------------------ This uses guards exactly as the chapter's own classify function demonstrates, with otherwise as the required fallback, tested against four different score ranges to confirm each guard fires at the correct boundary.