Listing A Procedure That Uses the Switch Function to Convert a Test Score into a Letter Grade

Function LetterGrade2(rawScore As Integer) As String

LetterGrade2

=

Switch( _

rawScore

<

0, "

ERROR! Score less than 0!",

rawScore

<

60,

"F", _

rawScore

<

70,

"D", _

rawScore

<

80,

"C", _

rawScore

<

90,

"B", _

rawScore

<=

100

, "A", _

rawScore

>

100,

"ERROR! Score greater than

End Function

End Function

0 0

Post a comment