Introduction
One purpose of the CSIS web site is to collect, and display, the current email addresses of all CSIS graduates. Graduates who visit the site are asked to provide their name, year of graduation, course of study, current email address and current location. This information is processed to extract the email domain, which is then stored, along with the other information, in the GraduateInfo file. The email domain is the part of the email address that follows the @ sign. For instance, ul.ie is the email domain in the email address - michael.coughlan@ul.ie.
A program is required which will produce a file, sorted on ascending email domain, from the GraduateInfo file. The new file should contain only information about graduates who have taken full CSIS courses (Course codes 1-5). The records of the file should contain only the email domain name, the student name, the year of graduation, the course name and the name of the country where the graduate is currently located. Report programs, written by others, will make use of this sorted file.
Files
GraduateInfo File
The GraduateInfo File is an unordered sequential file. Records of the file have the following description;
|
Field |
Type |
Length |
Value |
StudentName |
X |
25 |
- |
GradYear |
9 |
4 |
- |
CourseCode |
9 |
1 |
1-7 |
EmailAddr |
X |
28 |
- |
EmailDomainName |
X |
20 |
- |
CountryCode |
X |
2 |
- |
SortedEmailDomain File
The SortedEmailDomain File is a sequential file, ordered on ascending EmailDomainName. Records of the file have the following description -
|
Field |
Type |
Length |
Value |
EmailDomainName |
X |
20 |
- |
StudentName |
X |
25 |
- |
GradYear |
9 |
4 |
- |
CourseName |
X |
25 |
- |
CountyName |
X |
26 |
- |
Processing
In an Input Procedure, eliminate records of students who graduated in the Language and Computing or Language with Computing degrees (Course codes 6 and 7). The email address field is not required in the sorted file so make sure records sent to the Sorts work file do not contain this field.
In an Output Procedure, convert the CountryCode into a CountryName and the CourseCode into a CourseName.
The country codes and their corresponding names are contained in a sequential file (COUNTRYCODES.dat). To allow an efficient conversion of the country code to the country name this file must be loaded into a table in memory. There are currently 243 countries in the file.
CountryCode File
The CountryCodes file is a sequential file ordered on ascending CountryCode. Each record contains a CountryCode and its corresponding CountryName.
|
Field |
Type |
Length |
Value |
CountryCode |
X |
2 |
- |
CountryName |
X |
26 |
- |
CourseCode Table
The CourseCode can be converted into a CourseName using the pre-filled table provided in the program outline. The CourseName corresponds to the CourseCode as follows -
|
CourseCode |
CourseName |
1 |
Computer Systems |
2 |
Grad. Dip. Computing |
3 |
Grad. Dip. Localisation |
4 |
Grad. Dip. Music |
5 |
Computing with French |
6 |
Language and Computing |
7 |
Language with Computing |