CIS 71: Homework 11

Handed out: 11/07/06
Due: by 10:00pm on 11/20/06
Email program to TA.

Your program deals with files of student records:
    #define NAMESIZE 20
    struct student{
       char lname[NAMESIZE];  // lastname
       char fname[NAMESIZE];  // firstname
       int  mid;
       int  final;
       int  hmwks;
    };
We assume that all the records have different last names.

Your program will display to the user the following menu:

	1. Sort a file
	2. Merge two sorted files
	3. Query a sorted file
	4. Quit
	Enter your choice: 
If the choice is 1, 2, or 3 the corresponding action will be taken. Otherwise the user will be asked if to quit or continue.

If the choice was 1., the user is asked to enter the name of a file containing unsorted student records and of the file where to store such records in sorted order. Then the action is carried out.

If the choice was 2., the user is asked to enter the name of two sorted files of student records and the name of the merge file that has to be created. Then the action is carried out.

If the choice was 3., the user is asked to enter the name of a (sorted) file of students. Then in a loop the user is asked for the last name of a student and the correspondent record is printed out if present in the file. Otherwise an apology is given. The loop terminates when the null string is entered.

Here are two unsorted files of students records that you may use to test your program: students1.txt and students2.txt

As a comment at the beginning of your program you should do a case analysis for this problem: problem statement, analysis, design, implementation, and testing.