Grade

Report a typo

A test has five possible grades: A, B, C, D, and F. The grade ranges are as follows:

  • A: 90-100%

  • B: 80-90%

  • C: 70-80%

  • D: 60-70%

  • F: Below 60%

Your task is to determine a student's grade based on their score and the maximum possible score.

Note: The lower bound of each range is inclusive, while the upper bound is exclusive, except for grade A which includes 100%.

Hint: Calculate the student's score as a percentage of the maximum score. Then use conditional statements to determine which grade range the percentage falls into.

Input format: Two lines:

  1. The student's score

  2. The maximum possible score

Output format: The student's grade (A, B, C, D, or F)

Sample Input 1:

75
100

Sample Output 1:

C

Sample Input 2:

100
200

Sample Output 2:

F
Write a program in Python 3





___

Create a free account to access the full topic