In this example, we will print "Pass", "Fail" and "On Hold" depending on the 'Result' of the student. We are using a switch case pattern to determine the string. If the Result is 'P' we print 'Pass'; if the Result is 'F' we print 'Fail' else we print 'On Hold' if it is neither 'P' or 'F'.
Will you give this article a +1 ? Thanks in advance