Moved the letter grade mapping logic to the very end.
The flow of the program should be
1. check whether the input is valid or not
a)if string, then check if string is one of the valid letter grade (A+ is okay but A= is not okay and so on)
b)if number, then convert them to letter grade.

2. if not valid, then raise exception (raising exception will stop the program unless handled)
3. if valid, proceed with the mapping at the end.