Week 1
File Extensions
Look at the ending of a file name.
A file name.
A kind of file, or a general kind when the ending is unknown.
The question, more slowly
The question is: a file name comes in, and you print a media type based on the ending. The spec lists the endings it cares about, such as images and a pdf. Any other ending, or no ending, prints a general type.
Endings should be compared without caring about capitalization. The name can have more than one dot. The ending is the part after the last dot. A file with no dot has no ending.
People take the first dot instead of the last, so a name like archive.tar.jpg is misread. They also forget that .JPG and .jpg are the same ending.
Before you code
Write three file names on paper, including one with no ending, and say what kind each should be. Then check the spec's list.