CS 1401 Assignment #6

Date Assigned: Thursday, October 6, 2005 or Friday, October 7, 2005.

Due Date: correspondingly, Thursday, October 13, 2005, or Friday, October 14, 2005, before the beginning of your lab section.

Goals: to learn file objects and looping statements.

Points: This assignment is worth a total of 20 points. No late assignments will be accepted, but credit will be given for partially completed assignments turned in on time.

Assignment: Grades that CS1 students got on Test 1 are stored in a file cs1.dat. In this file, every odd line contains the name of a student, and every even line contains the number grade of this student.

For example, for two students, the first four lines will be:

Vladik Kreinovich
81
Luc Longpre
98

Your program should read the file, and print a table that describes:

For example, for the above-described file, your program should print the following:

Name:                        Grade:
-----------------------------------------
Vladik Kreinovich               81
Luc Longpre                     98
-----------------------------------------
Average:                        90
Create your own file with 6-8 lines of information, and test your program on this file.

For extra credit: programming problem 4, p. 265 of the book. Please note that you will only be given credit for the extra credit assignment if your main assignment works.

Deliverables: as announced in the labs and explained in the handouts given to you in the labs.