CSCI 4230
 Software Tools
Spring 2000
 Homework #2:

For a change, a more traditional and straightforward assignment for warm-up.

(1)    Write a simple perl program, h2.pl, to process raw student evaluation data for the School of Natural and Applied Sciences.  The input format:

Your program should be of this form:

h2q1.pl input.txt

It will generate the report inputout.txt.  The input file name may change.  The output file name is always the same as the input file name, with an additional substring "out" before the dot.  Generate appropriate error messages for command line argument and file name errors.

Statistical reports should be generated, including number of total responses, mean, standard deviation and number of individual response for each question.

For example, if the content of input.txt is

CSCI 5931A Advanced DB Dev.  Dr. Kwok-Bun Yue
777777777
777777777
665666556
677777777
677777777
777777777
777777777
77777777x
777777777
777777777
777777777
676777666
777777777
677777777
777775757
66666666x
777777777
777777777
777777777
777777777
777777777
777777777

The content of inputout.txt should be:

CSCI 5931A Advanced DB Dev.  Dr. Kwok-Bun Yue

Lowest possible rating: 1, highest possible rating: 7.
Total number of questions = 9.
Total number of respondents = 22.

Raw data:
777777777
777777777
665666556
677777777
677777777
777777777
777777777
77777777x
777777777
777777777
777777777
676777666
777777777
677777777
777775757
66666666x
777777777
777777777
777777777
777777777
777777777
777777777

Statistics:

Item                  Q1   Q2   Q3   Q4   Q5   Q6   Q7   Q8   Q9   mean
========================================================================
Number                22   22   22   22   22   22   22   22   20   21.8
Mean                6.73 6.91 6.82 6.91 6.91 6.82 6.82 6.73 6.90   6.84
Standard Deviation  0.46 0.29 0.50 0.29 0.29 0.50 0.50 0.63 0.31   0.42
 

Response  Q1   Q2   Q3   Q4   Q5   Q6   Q7   Q8   Q9   Total
=============================================================
7         16   20   19   20   20   19   19   18   18     169
6          6    2    2    2    2    2    2    2    2      22
5          0    0    1    0    0    1    1    2    0       5
4          0    0    0    0    0    0    0    0    0       0
3          0    0    0    0    0    0    0    0    0       0
2          0    0    0    0    0    0    0    0    0       0
1          0    0    0    0    0    0    0    0    0       0

You should write your program to generate a report as close to the one above as possible.

Turn in a floppy disk containing your program, program and output listing.  Use the above data for testing.  The teaching assistant will run your program will another data set.