Comp 170
Programming Assignment 4
Test Writer and Reader
100 Points
This assignment requires each
student to write two programs, one for a teacher one for a student. The teachers program, “Test Writer”, will be
used to create tests and save them to files to be administered later. The students program, “Test Taker”, will read
the test file, get an answer to each question from the student and grade the
test.
Three files will be submitted with
this program.
1. Test
Writer.cpp
2. Test
Taker.cpp
3. Test
Tags.h
- Only
multiple-choice and true/false questions are allowed.
- All Questions
will appear on only one line.
- Answers
can only have one line.
- Multiple-choice
questions will be marked by the tags, <MULTIPLE_CHOICE> and
</MULTIPLE_CHOICE>
- Each
incorrect multiple-choice answer will be preceded by a <ANSWER> tag.
- The
correct multiple-choice answer will be preceded by a
<CORRECT_ANSWER> tag.
- True/false
questions will be marked by the tags, <TRUE_FALSE> and
</TRUE_FALSE>
- The
answer to a true false question will appear in the form of a tag on the
line immediately following the question. <TRUE> or <FALSE>
- Tags
will always be on their own line. (No other text should appear on a tag
line.)
- Tags
should be case sensitive.
- The
student program will number the questions in sequential order.
- The
student program will letter the answers in sequential order for multiple
choice questions.
- The
multiple choice questions can have 1-26 associated answers.
- All
true/false questions will only have the choices T or F (case insensitive).
- The
“Test Writer” must let the teacher specify which answer is correct for
both types of questions.
- The
“Test Writer” must allow only one correct answer per question.
- The
user interaction with the test reader should be some what similar to Test Reader.exe
Test File example
<MULTIPLE_CHOICE>
Who is the president of Harding?
<ANSWER>
Bob Hope
<ANSWER>
Dana Steil
<CORRECT_ANSWER>
Dr. Burks
<ANSWER>
George Bush
</MULTIPLE_CHOICE>
<TRUE_FALSE>
Cows can fly.
<FALSE>
</TRUE_FALSE>
<TRUE_FALSE>
Cows can moo.
<TRUE>
</TRUE_FALSE>