← Back to If Statements
Question 337
Grade to GPA
Grade to GPA
Read a letter grade character (A,B,C,D, orF) withscanfand print the matching GPA to one decimal place using%.1f, with no trailing newline:A->4.0,B->3.0,C->2.0,D->1.0,F->0.0. For inputAthe output is4.0; forCit is2.0; forFit is0.0.
Expected Output:
4.0= newline. No newline after the last line.
Hints4 available
Sign in to use hintsTopics:
If Statements
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.