Letter Grade Points

Description:

At a particular university, letter grades are mapped to grade points in the following manner: Letter Grade points A+ 4.0 A 4.0 A- 3.7 B+ 3.3 B 3.0 B- 2.7 C+ 2.3 C 2.0 C- 1.7 D+ 1.3 D 1.0 F 0 Write a program that begins by reading a letter grade from the user. Then your program should compute and display the equivalent number of grade points. Ensure that your program generates an appropriate error message if the user enters an invalid letter grade. Mandatory: Use if and elif Test Case 1 Input (stdin) B+ Expected Output 3.3 Test Case 2 Input (stdin) C- Expected Output 1.7

Program :


n=input()

if(n=='A+'):

    print("4.0")

elif(n=='A'):

    print("4.0")

elif(n=='A-'):

    print("3.7")

elif(n=='B+'):

    print("3.3")

elif(n=='B'):

    print("3.0")

elif(n=='B-'):

    print("2.7")

elif(n=='C+'):

    print("2.3")

elif(n=='C'):

    print("2.0")

elif(n=='C-'):

    print("1.7")

elif(n=='D+'):

    print("1.3")

elif(n=='D'):

    print("1.0")

else:

    print("0")