The Department of Mathematics and Computer Science is currently reviewing applications for some teaching positions. In our deliberations, we use worksheets that list the candidates, with summaries giving their affiliations and specialties, and space next to each summary for observations and questions about their various qualifications. These worksheets are compiled by a Scheme program that collects the data from files prepared by the department's secretarial staff. A partially complete version of this program can be found at file-project.ss. Today's project is to fill in a missing piece and then to derive a couple of variants of the program that prepare summaries in slightly different formats.
Open an hpterm window and give the command
cat Applicant.cand
to see a typical candidate file, as prepared by the staff. Note that similar files for two other candidates (Frenoolian.cand and Spelvin.cand) are also provided.
Copy the file-project.ss program into an appropriately named file in your account, load it into XEmacs, and study it. Note how the various fields are identified within the program and consider how the various input and output procedures work.
Write the body of the discard-line procedure.
Load this program into Chez Scheme and give the command
(write-worksheet "worksheet.txt" candidate-roster)
to create the worksheet. In an hpterm window, examine the resulting file.
Modify the program so that it produces a similar worksheet, but with the name and address of each candidate suppressed and replaced with ``Applicant #1'', ``Applicant #2'', and so on.
Modify the program so that it produces a file containing only a list of the applicants' names and a count of the number of applicants. For the sample data, the output file might read
Dr. Leslie Applicant Dr. Pat Frenoolian Mr. George Spelvin 3 candidates
This document is available on the World Wide Web as
http://www.math.grin.edu/courses/Scheme/file-project.html