SDSU CS 596 Client-Server Programming
Second Assignment

[To Assignment Index]
San Diego State University -- This page last updated February 8, 1996
----------

Assignment 2 - Grade Reporter

1) Write a grade reporter program. The program reads two files, a password file and a grade file. When the user correctly types in their name and password on the standard input, the program displays the student's grades on the standard output. Using the sample files below, if Pete Chen ran the program and entered his name and password correctly, the program would print out:
namecoursehworkexam1exam2finalas1as2as3as4
Chen, Pete899289577910202916
Things not to Worry about

Don't worry about making the password file secure.
Don't worry about trying to "hide" the password when the user types it as input to the program.
The sample output above is in a nice table format. Don't waste time trying to make fancy output at this time.
File Descriptions

The password file contains names and passwords. A name contains a last name, followed by a comma, followed by a space, followed by a first name. Names and passwords are separated by a tab. A password does not contain any white space. The first line of the file contains the word "name", followed by a tab, followed by the word "password".
Sample Password File
name	password
Allen, Sally	cat
Battista, Joe	mOuse
Biag, Sam	doG
Chen, Pete	treefrog
Chen, Roger	mutter
Chen, Maggy	frameX
Chin, Linda	no12cat
Chiu, Marge	ufter
Chou, Sandy	laTe;sam


The grade file contains rows of data. The items in a row are separated by a tab, forming columns. Rows are separated by line feeds. The first row contains labels for each of the columns. The first item in all rows (excluding the first row) is the name of a student. The remaining items in a row are the student's scores for the assignment/exam/etc. indicated by the label of the item's column.
Sample Grade File
name	course	hwork	exam1	exam2	final	as1	as2	as3	as4
Allen, Sally	87	92	85	55	74	10	18	29	18
Battista, Joe	92	98	98	55	78	10	20	30	20
Biag, Sam	83	91	78	51	72	8	21	29	18
Chen, Pete	89	92	89	57	79	10	20	29	16
Chen, Roger	74	68	59	61	55	10	0	29	18
Chen, Maggy	80	95	68	55	46	10	20	29	18
Chin, Linda	79	93	67	54	50	10	18	30	18
Chiu, Marge	88	92	85	53	84	9	20	29	18
Chou, Sandy	92	92	86	60	85	9	21	29	17

----------