In what concerns the continuous evaluation solving exercises grade during the semester, you should submit until 23:59 of October 26th
(this exercise will still be available for submission after that deadline, but without couting towards your grade)
[to understand the context of this problem, you should read the class #03 exercise sheet]
Can you help the teacher grade the "Introduction to Programming" exams?
Write a program that, given a numeric grade, assigns a corresponding scale based on the following criteria:
Percentage Range | Grade |
---|---|
[90%, 100%] | 5 |
[70%, 90%[ | 4 |
[50%, 70%[ | 3 |
[20%, 50%[ | 2 |
[0%, 20%[ | 1 |
The input consists of a single floating-point grade representing the grade.
The output should be a single line displaying the corresponding scale (1, 2, 3, 4, 5, or "NA").
The following limits are guaranteed in all the test cases that will be given to your program:
-150 ≤ grade ≤ 150 | Range of grades |
Example Input 1 | Example Output 1 |
65.5 |
3 |
Example Input 2 | Example Output 2 |
120 |
5 |
Example Input 3 | Example Output 3 |
-42 |
NA |
Example Input 4 | Example Output 4 |
49.98 |
2 |