// Chapter 34 example: a function with many cases, for a table-driven test. // // Run its tests from this folder: // cd exercises/34/examples/02-table-test // go test -v package grade // Letter turns a score from 0 to 100 into a letter grade. func Letter(score int) string { switch { case score >= 90: return "A" case score >= 80: return "B" case score >= 70: return "C" case score >= 60: return "D" default: return "F" } }