Computer Science 202
Systems Programming Concepts Using C
Lab 9 - On-line Test Administration System
You are to write a program that will administer a test via the computer.
Your program will read in a list of questions and possible answers. The
user will be given the test one question at a time and their answers
recored. Once the test is complete the program will grade the test and
present the results.
Your program will use TWO input files. The first is the list of questions and
the possible answers to each question. The first item in this file will be
the number of questions. You can assume that each question has four possible
answers ( a, b, c, and d ). The second file is simply the answer key.
Example of each of these files are shown below:
What is the capital of Michigan?
What is the capital of Connecticut?
Answer key file
Reasonable final output would be:
Number correct: 2 out of 2 for a 100.00 percent.
Note that the test file contains the questions and answers only, and that each one
is one a separate line. When these questions are presented to the user it would be
nice if the options a), b), and so on were written in front of each of the
The single input to this program is given on the command line and is the base
name of the exam. If the base name was exam1 then the question file would
be named exam1.test and the answer key would be exam1.key.
To discourage students from looking up each of the answers, each question
will have a time limit of 15 seconds. If the student fails to answer the
question in 15 seconds, then they get the answer wrong and move on to the next
Demonstrate that your program can read in the .test file and correctly
display the first question on the exam.
The following must be delivered to your instructor via text-only email no later
than midnight of 11th Monday.
In addition, you must deliver to the instructor at the start of class (Lab) on
11th Tuesday the following:
- Source code for your program.
- Sample test questions. NOTE you cannot use the sample test given here, be
creative and generate you own.
- Sample test answers.
- A printed copy of your source code.
- I suggest getting the program working without the time limit first, then
add in the time limit.
- Partners are allowed in this lab, BUT NOTIFY ME IN WRITING.