changeGrade is an operator for grade values.

changeGrade(grade, delta)

Arguments

grade

a string containing the current grade in the form G?, where ? is a number.

delta

a number containing the relative change in grade to apply. 0 retains the current grade as-is.

Value

a string containing the new grade.

Examples

changeGrade("G4",  0) ## G4
changeGrade("G4",  1) ## G5
changeGrade("G4", -1) ## G3
changeGrade("G10", 1) ## G11