BlueBook

p307ex7: Grades

Given T (1 ≤ T ≤ 100) integers in the range (-1000, 1000), representing percentages, calculate which letter grade each of them correspond to.

The mark table is as follows :

Grade Marks Range
A 80 - 100
B 70 - 79
C 60 - 69
D 50 - 59
F 0 - 49
X Anything else...

Input

Line 1 : One integer T
Lines 2 .. T + 1 : One integer N

Output

Lines 1 .. T : One character denoting the letter grade received.

Sample Input

3
10
99
101

Sample Output

F
A
X

All Submissions
Best Solutions


Point Value: 3
Time Limit: 2.00s
Memory Limit: 16M
Added: Oct 28, 2008

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

Comments (Search)

how does it work
not understanding

i still do not get
help


Do not post code. Read the question. Your code doesn't work for the sample input.

My code isn't working it says

135234.pas(1,3) Fatal: Syntax error, \"BEGIN\" expected but \"identifier AR\" found
Fatal: Compilation aborted
Error: /usr/bin/ppc386 returned an error exitcode (normal if you did not specify a source file to be compiled)

Theres many problems with your code...naughty.gif
1. where's your loop?
2. else if don't use semicolon until the last statement
3. where is your else if? you did not even put an if in front of some of the blah>blah thingies.
4. You need parentheses for the blah>blah thingies.


There are probably many more errors that I did not say

You wrote 'AR' instead of Var, along with the multiple things Henry mentioned. Please use a loop to read the multiple inputs (T) and you don't need the semicolons before the else if, the Compiler is just telling you to do some because you put a semicolon after the if statement, though it should only be used for the final else.