I have to write a program helps your instructor grade quizzes. The program will read a file containing a single student’s answers to a recently given quiz. It will compute the student’s grade on the test as a percentage, and then print a report Your program should read the file answers.dat. This file contains the name of the student who took the quiz, and his answers for each question. The answers file has the following format: The student name is always the first line. A student name may or may not have last names. A quiz always has 11 questions. There is one answer per line. Each answer is one word and all lowercase.
Nowhere do I see you actually opening the file. You're just naming it. Also, you don't have to declare your function, as in line 7, unless you place the function BELOW main().