g | x | w | all
Bytes Lang Time Link
060AWK250910T143717Zxrs
019Thunno230302T164614ZThe Thon
049Excel230302T152638Zpneumann
018Stax180302T225527ZWeijun Z
039Perl 6180302T202703Zbb94
01905AB1E180302T181256ZMagic Oc
034V180302T093043Zoktupol
044R170909T172649ZGiuseppe
041Jotlin180228T210233Zjrtapsel
030K oK180228T223022Zmkst
053Excel170911T100058ZWernisch
050Rabbit~170915T130859ZAdam
059PowerShell170911T130816ZAdmBorkB
050Python 3170909T170927ZMr. Xcod
021Japt170909T155413ZShaggy
055Java 8170911T083247ZKevin Cr
055Bash170911T013234ZJustin M
110C#170910T211622Zsnorepio
074Ly170910T082405ZLyricLy
025Pyth170909T171816ZMr. Xcod
028Pyke170909T203855ZMr. Xcod
051Javascript ES6170909T142705ZEndenite
061C170909T141725ZSteadybo
040TIBasic170909T185743ZTimtech
056Kotlin170909T174724Zjrtapsel
nanPerl 5170909T173323ZXcali
030Recursiva170909T145729Z0xffcour
031J170909T152229Zmiles
014Jelly170909T150049ZJonathan
030Pyth170909T145953ZKaran El
019Jelly170909T145839Zfireflam
077Python 2170909T140752ZJonathan

AWK, 60 bytes

$0=$0<301?$0<295?$0<181?$0<171?$0<14?"F":"E":"D":"C":"B":"A"

Attempt This Online!

Thunno, 19 bytes

"\rª´ĦĬ"O>S70_C

Attempt This Online!

Uses the same method as quite a few other answers.

Explanation

"\rª´ĦĬ"O>S70_C    # Implicit input
"\rª´ĦĬ"O          # Push the list [13, 170, 180, 294, 300]
         >         # Check if the input is greater than these numbers
          S        # Sum the resulting list
           70_     # Subtract the sum from 70
              C    # And this codepoint into a character
                   # Implicit output

Excel, 49 bytes

=MID("FEDCBA",MATCH(A1,{0;14;171;181;295;301}),1)

just taking advantage of the MATCH function's default match type behaviour but i'm sure there's a shorter answer

if someone has more experience with excel, please comment any ways i can improve this answer!

Stax, 18 bytes

5"«µħĭ",+|oH-VA@]

Run and debug online!

Explanation

Bytes counted in CP437.

5"«µħĭ",+|oH-VA@]
5            -        5 minus the result of the following
 "«µħĭ"                   [14, 171, 181, 295, 301]
        ,+                Append input
          |oH             Index of last element if the array were to be sorted
              VA@]    Letter in the alphabet with the given index

Perl 6, 42 39 bytes

{chr(65+[+] "\rª´ĦĬ".ords »>»$_)}

05AB1E, 19 bytes

•5r¥[‚=€®•3ô›_ASsϤ

Try it online!

V, 37 34 bytes

aFEDCBA5äh113äh9äh156äh13ähÀ|vyVp

Try it online!

Hexdump:

00000000: 3133 4146 1b31 3536 4145 1b39 4144 1b31  13AF.156AE.9AD.1
00000010: 3133 4143 1b35 4142 1b36 3441 411b eec0  13AC.5AB.64AA...
00000020: 7c76 7956 70                             |vyVp

Basic idea:

R, 50 44 bytes

LETTERS[6-sum(scan()>c(13,170,180,294,300))]

Try it online!

same as the javascript answer, but uses R's vectorization and LETTERS builtin to come in a tiny bit shorter.

Thanks to rturnbull for shaving off those last 6 bytes.

Jotlin, 48 41 bytes

{v->'F'-l(13,170,180,294,300).f{a<v}.l()}

Whole program:

var x:(Int)->Char =
{v->'F'-l(13,170,180,294,300).f{a<v}.l()}

println(x(12))
println(x(15))
println(x(301))
println(x(181))

Ported my previous Kotlin answer here.

K (oK), 30 bytes

Solution:

"FEDCBA"@0 14 171 181 295 301'

Try it online!

Explanation:

Index into the correct bucket:

"FEDCBA"@0 14 171 181 295 301' / the solution
         0 14 171 181 295 301' / bin (') input in a bucket
"FEDCBA"@                      / index (@) into "FEDCBA"

Excel, 53 bytes

Sum of conditions, then returns the required ASCII character:

=CHAR((A1<14)+(A1<171)+(A1<181)+(A1<295)+(A1<301)+65)

Alternative solutions:

Summing conditions, return string index (63 bytes):

=MID("ABCDEF",(A1<14)+(A1<171)+(A1<181)+(A1<295)+(A1<301)+1,1)

Rabbit~, 50 bytes

(Noncompeting, postdates question. I just finished the interpreter(yay) and wanted to try and solve something. This is also my first code golf thing ever)

=>FEDCBA$<({.0-\_-^\-&^?n&&}_}\>\{{\>:.¤})Ð"ỤṅỌrḲA

It basically takes the differences from one grade to the next 14,157,10,114,6,65 (encoded as ỤṅỌrḲA) and subtracts from the input. If a negative number is found it stops progressing along the 'FEDCBA' sequence and outputs the letter.

Small explanation of this beautiful piece of syntax

Rabbit~ uses a grid based memory with one or several carets you can move around; this solution uses 2.

=>FEDCBA$<({.0-\_-^\-&^?n&&}_}\>\{{\>:.¤})Ð"ỤṅỌrḲA - Full program.

  FEDCBA                                           - Load bytes into grid
                                          Ð"ỤṅỌrḲA - Load bytes 14,157,10,114,6,65 into second line of data grid
=                                                  - Read input
 >       <      _ ^   ^     _  >   >               - Move caret (most instructions read from the grid below the active caret)
        $                                          - Create a new caret
          (                              )         - Loop
           {.0             } }   {{     }          - Conditional statement checking if value at caret == 0 then move active caret to next grade else print and quit
              -  -  -                              - Subtract 
               \   \          \ \                  - Cycle active caret
                     &   &&                        - Bitwise and to see if number is negative
                       ?n                          - Get negative sign bit
                                    :.             - Print value at caret as character
                                      ¤            - Terminate program

PowerShell, 59 bytes

(,'F'*14+,'E'*157+,'D'*10+,'C'*114+,'B'*6+,'A'*65)["$args"]

Try it online!

Similar-ish to Jonathan Allen's Jelly answer, in that we're constructing an array of all the letters concatenated together, then indexing into that array with the input $args.

Python 3, 50 bytes

Thanks to @jferard for -4 bytes.

lambda n:chr(70-sum(n>ord(x)for x in"\rª´ĦĬ"))

Try it online!

Python 3, 54 bytes

lambda n:chr(70-sum(n>x for x in[13,170,180,294,300]))

Try it online!

Saved 2 bytes thanks to @mathmandan, and indirectly thanks to @JonathanFrech.

Python 2, 56 bytes

lambda n:"ABCDEF"[sum(n<x for x in[14,171,181,295,301])]

Try it online!

Japt, 23 21 bytes

'Gc-[#ªT#´D294L*3]è<U

Try it


Explantion

Implicit input of integer U.

'Gc-

Subtract from the codepoints of the (single character) string G ...

è<U

The count of elements less than U ...

[#ªT#´D294L*3]

In the array of 170 (), 0 (T), 180 (), 13 (D), 294 (literal) & 300 (L*3), so formatted and ordered to avoid the use of delimiting commas. 0 could be removed (subtracting from the codepoint of F instead) but then a comma would need to be added or C*F (12*15) used for 180, ultimately saving no bytes.

Java 8, 55 bytes

n->n<14?'F':n<171?'E':n<181?'D':n<295?'C':n<301?'B':'A'

Try it here.

Alternative 57 bytes:

n->(char)(n<14?70:n<171?69:n<181?68:n<295?67:n<301?66:65)

Try it here.

Alternative 60 bytes:

n->"FEDCBA".charAt(n<14?0:n<171?1:n<181?2:n<295?3:n<301?4:5)

Try it here.

Maybe some kind of formula can be find to get 0-5 in a shorter way than n<14?0:n<171?1:n<181?2:n<295?3:n<301?4:5 using the last approach. Still investigating this.

Bash, 55 bytes

echo obase=16\;10 $[$1<{14,171,181,295,301}]|tr \  +|bc

Try it online or Verify test cases.

C#, 110 bytes

x=>{if(x<14)return"F";if(x<171)return"E";if(x<181)return"D";if(x<295)return"C";if(x<301)return"B";return"A";};

Try it online

Ly, 74 bytes

n(14)L["F"o;]p(171)L["E"o;]p(181)L["D"o;]p(195)L["C"o;]p(301)L["B"o;]"A"o;

Try it online!

A simple if-chain approach. I doubt it can be made much shorter.

Pyth, 25  26  bytes

@<G6sgRQ[13*17T180*30T294

Verify all the test cases.

Explanation

@<G6sgRQ[13*17T180*30T294 - Full program.

  G                       - The lowercase alphabet.
 < 6                      - With the letters after the index 6 trimmed. We will call "S".
        [                 - Initialise a list literal.
         13               - The literal 13.
           *17T           - The integer 170, composed by 17 * 10, so save whitespace.
               180        - The literal 180.
                      294 - The literal 294.
                  *30T    - The integer 300, composed by 30 * 10.
     gRQ                  - For each element, return 1 if is is ≥ the input. 0 otherwise.
    s                     - Sum.
@                         - Get the index into S of ^.
                          - Output implicitly.         
        

Pyke, 28 bytes

G6<13T17*180T30*294]5FhQ>)s@

Try it here!

Explanation

G6<13T17*180T30*294]5FhQ>)s@ - Full program. T is the constant for 10.

G                            - The lowercase alphabet.
 6<                          - With the letters after the index 6 trimmed.
   13                        - The literal 13.
     T17*                    - The integer 170, composed by 17 * 10, to save whitespace.
         180                 - The literal 180.
            T30*             - The integer 300, composed by 30 * 10. 
                294          - The literal 294.
                   ]5        - Create a list of 5 elements.
                     FhQ>)   - For each element in the list.
                      h      - Increment.
                       Q     - The input.
                        >    - Is smaller ^^ than ^? Yields 1 for truthy and 0 for falsy.
                         )s  - Close loop and sum.
                           @ - Get the index in the alphabet substring explained above.

Javascript (ES6), 51 bytes

n=>"ABCDEF"[(n<14)+(n<171)+(n<181)+(n<295)+(n<301)]

Alternative solutions (longer):

53 52 bytes (-1 byte thanks to @Arnauld)

n=>"FEDCBA"[n>300?5:n>294?4:n>180?3:n>170?2:+(n>13)]

55 53 bytes (-2 bytes thanks to @Neil)

n=>"AFEDCB"[[14,171,181,295,301].findIndex(m=>n<m)+1]

55 bytes

n=>"FEDCBA"[[13,170,180,294,300].filter(m=>n>m).length]

Example code snippet:

f=
n=>"ABCDEF"[(n<14)+(n<171)+(n<181)+(n<295)+(n<301)]
console.log(f(12))
console.log(f(15))
console.log(f(301))
console.log(f(181))

C, 62 61 bytes

Thanks to @Jonathan Frech for saving a byte!

f(n){putchar(70-(n<14?0:n<171?1:n<181?2:n<295?3:n<301?4:5));}

Try it online!

C, 57 bytes

#define f(n)70-(n<14?0:n<171?1:n<181?2:n<295?3:n<301?4:5)

Try it online!

C (gcc), 54 bytes

f(n){n=70-(n<14?0:n<171?1:n<181?2:n<295?3:n<301?4:5);}

Try it online!

C (gcc), 50 bytes

Using @Herman Lauenstein's solution.

f(n){n=65+(n<14)+(n<171)+(n<181)+(n<295)+(n<301);}

Try it online!

TI-Basic, 40 bytes

sub("FEDCBA",sum(Ans≥{0,14,171,181,295,301}),1

Kotlin, 56 bytes

{v->'F'-listOf(13,170,180,294,300).filter{it<v}.count()}

Try it online!

Beautified

{ v->
    // Count the grades passed, then subtract that from F
    'F' - listOf(13,170,180,294,300)
            .filter { it < v }
            .count()
}

Test

var x:(Int)->Char =
{v->'F'-listOf(13,170,180,294,300).filter{it<v}.count()}

fun main(args: Array<String>) {
    println(x(12))
    println(x(15))
    println(x(301))
    println(x(181))
}

Perl 5, 47 + 1 (-p) = 48 bytes

$_=((F)x14,(E)x157,(D)x10,(C)x114,(B)x6)[$_]||A

Try it online!

Recursiva, 49 30 bytes

Y(++++<a301<a295<a181<a171<a14

Try it online!

Allow me to answer my own question in my own language. :D

Explanation:

Y(++++<a301<a295<a181<a171<a14
      <a301<a295<a181<a171<a14 calculate true/false for all the conditions
  ++++                         sum up all the conditions to obtain n which can be either 0,1,2,3,4 or 5
 (                             yield upper-case Alphabet
Y                              Get n-th element   

J, 31 bytes

'FEDCBA'{~13 170 180 294 300&I.

Try it online!

Explanation

'FEDCBA'{~13 170 180 294 300&I.  Input: n
          13 170 180 294 300     Constant array [13, 170, 180, 294, 300]
                            &I.  Use it with interval index to find which of
                                 the intervals (-∞, 13], (13, 170], (170, 180],
                                 (180, 294], (294, 300], (300, ∞) n can be inserted at
        {~                       Index into
'FEDCBA'                         This string and return that char

Jelly,  18 17 15  14 bytes

NịØAx“A©r½ɗÇ‘¤

A monadic link taking a number and returning a character.

Try it online! or see all input-output pairs.

How?

NịØAx“A©r½ɗÇ‘¤ - Link: number, d
N              - negate d
             ¤ - nilad followed by link(s) as a nilad:
  ØA           -   uppercase alphabet yield = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
     “A©r½ɗÇ‘  -   code-page indices = [65,6,114,10,157,14]
    x          -   times = 'A'x65+'B'*6+'C'x114+'D'x10+'E'*157+'F'*14
 ị             - index into (1-indexed & modular - hence the negation to allow all Fs
                                                   to be together at one end)

Pyth, 30 bytes

@GtlfgTQmCdc"\r ª ´ & , m"d

The site doesn't seem to show the character with code point 1, so you need to insert a character with code point 1 before the &, ,, and m at the end

(Replace all 1s with character with code point 1):

@GtlfgTQmCdc"\r ª ´ 1& 1, 1m"d

Jelly, 19 bytes

“n-'‘+⁹;“ỌẠÇ‘ð>SịØA

Try it online!

Footer executes all test-cases and formats the output.

Python 2, 77 bytes

lambda n:chr(70-sorted(_*(n>(0,13,170,180,294,300)[_])for _ in range(6))[-1])

Try it online!