Algoritmer och datastrukturer med objektorienterad programmering

Uppgift 1

Grading a Test

Objectives

Problem

Write a program to grade a set of true/false tests. There are 15 true/false questions. True is represented by T, and false is represented by F. The program reads input from a file and produce output on the screen.

Format of input file

The first line consists of 15 characters representing the key to the quiz. The rest of hte lines are student responses, one per line. Each student's name (maximum of 15 characters) immediately follows the student's last answer.

Processing of the file terminates when end-of-file is reached.

Format of output

For each student write out the name followed by the number of questions answered correctly and the number missed.

Sample of data

Here is a sample of the data: Input
The data as described in the Problem Statement. Here are the first three lines of input:

TFTFTFTFTTTFFFT
TFTFTFTFTTTFFFTJoe Jones
TFTFTFTFTTTFFFFJanet Jerome
Output
Each student's name followed by the number of questions answered correctly and the number missed:

Joe Jones	15	0
Janet Jerome	14	1
Important

Submissions

  1. A properly commented listing of your program.
  2. A listing of your output file serving as a sample run with "quiz.dat" as input.
Please follow these submission instructions. Good luck!

  Anders Berglund			office	    + 46 (18) 471 31 67
  Department of Computer Systems        mobile	    + 46 (70) 425 02 11
  P.O. Box 325				fax, direct + 46 (70) 411 02 14
  S-751 05 Uppsala			fax, dept   + 46 (18) 55 02 25
  Sweden				
  e-mail: Anders.Berglund@docs.uu.se