IUP Computer Science
CO 110 Fall '99

Project #5
(Due 15 November 1999)

A multiple choice examination has been given to a psychology class. The exam consisted of 30 questions. The answer key for the exam and the student's responses to the questions are in a file named EXAM.TXT You can obtain a copy of this file from I:\JLWOLFE\EXAM.TXT You are to write a C++ program that does the two standard actions needed for any exam: 1) determine what each student scored on the exam and 2) determine whether or not any of the exam questions were unfair.

The EXAM.TXT file has the following form. The first line in the file consists of the 30-question answer key followed by the number of students who took the exam. It might look like this

DACCBEFDAABCCAFDDDBABBCEDFAFCB 47>

if 47 students took the exam. Then, on 47 subsequent lines in the file are the answers that each of the students made to the questions and the student's name (separated from the answers by one space). So, Wendy's answers might look like this

DACABECDAABCCAFDDDBABDCEDFAFCB Wendy

There are 10 characters for a student's name, so only first names are used. Shorter names, like Wendy's, are followed by an appropriate number of spaces to fill out the 10 characters.

Your program is 1) to determine what score each student made on the exam, as a percentage; 2) to determine the average score for the exam (by averaging the scores for all students); 3) to determine the percentage of students who got each question correct; and 4) to identify questions for which the percentage correct was less than 1/2 of the student's average score - these are the questions we regard as unfair. All of your results are to be written to an output file named ANALYSIS.TXT with appropriate labeling.

You will need to use arrays to do this program. You should also separate some of the tasks into functions and not have just a single main function. As usual, you need to provide comments, identifier naming and a program layout that conforms to the style guide. Hand in a disk which contains your source program file and the ANALYSIS.TXT file (make sure your name is part of the output to the file, so that one program's output can be distinguished from another). On the back page is a sample of what ANALYSIS.TXT might look like when you are done. The form of output you use does not have to match mine exactly; but it should be neat, complete, and easy to read.

Examination Results - Student Scores
(produced by Jim Wolfe)

Student   Score
Carol       76%
Maria       90%
Warren      83%
Elizabeth   83%
Dennis      76%
Tanya       96%
Keith       86%
Alexander   83%
Karen       63%
Ronald      73%
Larry       56%
Kathy       66%
Jan         83%
Frederick   50%
Lucille     80%
Arthur      66%
Alan        66%
Sarah       50%
Diane       66%
Boyd        76%
Melanie     66%
Barry       80%
Sue         70%
Mortimer    86%
Grady       70%
Hannah      66%
Isaac       86%
Evan        46%
Neil        86%
Sharon      66%
Madeline    70%
Hayden      73%

The average for 32 students is 72

Report on Performance of Questions
Questions with correct percentage too low
are marked with *

Question  Correct
      1      78%
      2      78%
      3      71%
      4      90%
      5      78%
      6      75%
      7      37%
      8      68%
      9      75%
     10      75%
     11      34%  *
     12      81%
     13      78%
     14      87%
     15      84%
     16      81%
     17      78%
     18      78%
     19      25%  *
     20      78%
     21      68%
     22      75%
     23      71%
     24      81%
     25      81%
     26      81%
     27      90%
     28      75%
     29      71%
     30      68%