If you have not done so already, please finish the first lab on files.
a collection of utilities for reading from files.
a. Create a file,
values, of at least four lines
that contains at least two numbers on each line.
read-line-of-values, write a procedure that opens
values, reads each line, computes an average for that
line, and prints out the average.
Consider the class list, as distributed by the registrar.
a. Write a procedure that reads in the lines of the class list and prints
out only the majors. You should use
read-line (from our
b. Write a procedure that writes a summary of the class year and
majors of the students to a file,
some sample (incorrect) contents:
Years: 1st: 20 2nd: 5 3rd: 2 4th: 10 Majors: UND: 10 GRM: 5 BIO: 1 MAT: 6
Disclaimer Often, these pages were created "on the fly" with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.
This page may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CS151/2000F/Labs/more-files.html
Source text last modified Tue Nov 7 10:53:31 2000.
This page generated on Tue Nov 7 10:58:13 2000 by Siteweaver. Validate this page's HTML.
Contact our webmaster at email@example.com