Grade (2)

Write a function @grade(s)@ that given a float score s such that
0 ≤ s ≤ 10 returns the grade string that corresponds to s. The result of
the function has to stick to the catalan grading rules: when s is less
than 5 the grade is ’suspens’, when s is at least 5 but less than 7 the
grade is ’aprovat’, when s is at least 7 but less than 9 is ’notable’,
when s is at least 9 but less than 10 is ’excel.lent’ —note that the dot
is the usual one— and finally, if s is 10 the grade is ’MH’.

Sample session

Problem information

Author: ProAl

Generation: 2026-01-25T16:46:33.555Z

© Jutge.org, 2006–2026.
https://jutge.org
