COSC 3353 Assignment 3

Purpose: This lab focuses on writing a scheme program that reads from files and uses lists.

Due: Before class on February 25 (late assignments will not be accepted)

Requirements C++ Programs: You will be writing a Scheme program for this lab that reads from a file and processes the data from that file. There are three data files, that are in comma delimited format, that contain varying numbers of words. For example the first file looks like this:



What this means is that this file contains 12 words, with a comma separating each of the words. You will not know how many words are in the file, until you open and process the file. In fact, one of the files will have over 180,000 words in it.

Your task is to find the word or words in each file that has the most A's, B's, C's, ..., and Z's and output for each letter the word or words. For example your output for the example file might look like:

A - Apple, cat, car
B - Not used
C - cat, car
D - dog
E - tree, keep,

Z - zoo

Treat upper case and lower case letters as the same.

You must use defensive coding, there may be more or less words in the file than the first number given. If there are more words in the file than the number of words given at the beginning of the file, stop processing the file when the number of words exceeds what was given at the front of the file. If there are less words than the number of words at the beginning of the file, stop processing when you run out of words.

Scheme has a full set of string-processing procedures.

The program must be well documented. Please include an output file of your program processing the three example files.

Here are the three example word files. The files I use to test your program on will be different in size, but will be in the same file format. I suggest you test with the first file and after that works properly test with the larger files.

Lab Report. Prepare a lab report that contains the following information:

Submission: You will be submitting this lab via email. Attach all of the files to your email. This package will then be forwarded to other students so they can do a code review.

Grading Criteria: 100 points available for this assignment.