Here's why:
* Vowels: The vowels in the English alphabet are A, E, I, O, and U.
* Consonants: All other letters are consonants.
While "y" can sometimes act as a vowel (like in "my" or "fly"), in the word "cody" it is making the "c" sound, which is a consonant sound.