The George WashingtonUniversity
School of Engineering and Applied Science
Department of Electrical Engineering and Computer Science

CS 131 - Data Structures
Help with Programming Project #1

Due Date: February 6, 1997

Before you start, make sure you have a csci131 directory. If you don't, use the following command to create one:
mkdir csci131
Once in the csci131 directory (use cd csci131), copy the files you need to use in this assignment from the programs131 directory. To copy files from programs131 directory use:
cp ~/programs131/filename .

The first programming project involves writing a simple student information system. The type definitions for the student information system are the following:

TYPE Student_Record IS 
  RECORD
    Name: String(1..15);
    Birth_Date: Date;
    Tuition: Quantity;
    Amount_Paid: Quantity;
    Grade_Point: Rational;
  END RECORD;
Students: CONSTANT Integer :=35;
TYPE Student_File IS ARRAY(1..Students) OF Student_Record;

Your program should read in information for no more than 35 students from a file that you create. This info should be entered in the Student_File array defined above.

If you do not want to use file input operations for this assignment, you can use file redirection. The program thinks it is getting input from the keyboard, but it is actually getting input from a file. The command for file redirection is:
gexecute program.exe < inputfile.txt

The birth date in the input file should consist of three integer values: month, day and year. The tuition and amount paid should be floating point numbers, and the grade point should be a pair of integers: total quality points and credit hours completed. Your program should convert the date information to type Date as defined by the Dates package. It should convert the tuition and amount paid to type Quantity defined in the Currency package. Finally, it should convert the grade point average to type Rational as defined in the Rationals package.

An example of input for one student is:

Calculate GPA
GPA = Total Quality points / Total Credit hours

Once the information has been read in, your program should print out a report, including all the information in the file and also the amount owed for each student. In addition, the average age and average grade point average should be computed.

Average Age (Year only) should be calculated. For example, if the student was born on 8/20/1980 that student age is 17 (1997-1980=17).

For each student, the report should note whether the student's GPA is above average or below average. Use the Put procedures for Dates, Quantity, and Rationals as appropriate to output the values. The average age and grade point average output should be floating point numbers.

Your program must use the packages Dates, Dates.IO, Currency, Currency.IO, Rationals, and Rationals.IO defined in the textbook. You must complete any incomplete parts of these packages.

For example: to complete part in Rationals.adb.