Under construction

Still being built. Things may change

Grade Point Calculation

Time limit1sMemory limit128 MB

Summary
Read a letter grade string and print its corresponding fixed grade point value from a lookup table.
Level

Easy1 of 10

Topics
Implementation, Hash map
Solved
No attempts yet

Problem

Given a grade for a C language course, write a program that prints the grade point corresponding to that grade.

The grades and grade points are as follows.

GradeGrade point
A+4.3
A04.0
A-3.7
B+3.3
B03.0
B-2.7
C+2.3
C02.0
C-1.7
D+1.3
D01.0
D-0.7
F0.0

Input

The first line contains the grade for the C language course. The grade is one of the 13 values shown in the table above.

Output

Print the grade point corresponding to the given grade on the first line.

Examples1

  1. Example 1

    Input
    A0
    
    Expected output
    4.0