Time to complete
Allow 30 hours continuous
Input Data Files

Occupations.dat
(On each country line, the name of the most common occupation of visitors from that country must be displayed. But records in the Evaluation Form file only contain a code that represents the visitor occupation so this code must be converted into the name of the occupation.    The occupation codes and their corresponding names are contained in a sequential file (Occupations.dat). )

EvalForm.dat
The Evaluation Form File, is an unordered sequential file that contains the results from the Evaluation Form on the CSIS web site.


Introduction

Visitors to the CSIS web site are asked to fill in an evaluation form. The form requests the name of the visitor, his/her country of origin, his/her occupation, an evaluation of the web site, and an optional comment. These fields are stored as a fixed length record in an Evaluation Form file (EvalForm.dat).

A program is required which will produce a report from the Evaluation Form file.  For each country from which the site has been visited the report should show-

  • The name of the country
  • The number of visitors from this country
  • Most common occupation of visitors from this country
  • The average evaluation of the web site by visitors from this country.

The report must be implemented as an HTML web page and the information on the page should appear in ascending country name sequence.

In the course of creating the HTML web page, the program must produce a sorted file containing the VisitorCountryName, VisitorOccupation and SiteEvaluation fields.

Evaluation Form File

The Evaluation Form File (EvalForm.dat), is an unordered sequential file, with the following record description;

FieldName Type Length Value
VisitorName X 20 -
VisitorCountryName X 20 -
VisitorOccupation X 2 -
SiteEvaluation 9 1 1-5
VisitorComment X 35 -

File Conversions

Visitor Occupation

On each country line, the name of the most common occupation of visitors from that country must be displayed. But records in the Evaluation Form file only contain a code that represents the visitor occupation so this code must be converted into the name of the occupation.    The occupation codes and their corresponding names are contained in a sequential file (Occupations.dat). To allow an efficient conversion of the occupation code to the occupation name this file must be loaded into a table in memory.   There are currently 25 occupations in the file but you must write your program so that it is easy to extend the number of occupations. 

Occupation File

The Occupation File (Occupations.dat) is a sequential file ordered on ascending OccupationCode.   Each record contains a CountryCode and its corresponding CountryName.

Field Type Length Value
OccupationCode X 2 -
OccupationName X 23 -

Site Evaluation

The SiteEvaluation field is a numeric value.   In the report, the rounded average of the evaluations for a particular country must be shown.   But the average must be printed as text, not as a numeric value.  The evaluation values and their text equivalents are given below and must be set up as a predefined table of values in your program.

Value Text Equivalent
1 Excellent
2 Very Good
3 Good
4 Poor
5 Very Poor

The report also requires an overall evaluation.  This is the average of the evaluations of all the visitors to the site.

The HTML report page

The report must be produced as an HTML page to be viewed in a web browser.   In the <TITLE> tag, the title of the page should be CSIS Evaluation Form Report.  In the <BODY> tag the background colour should be white – i.e. #FFFFFF.   The other colours and fonts used are left to the discretion of the programmer but they should make the report as easy to read as possible.   Reports that are easy to read, because they make good use of font, colour and text alignment, will tend to attract marks.

The country lines of the report must appear in ascending country name sequence.  Numeric values must be zero suppressed up to but not including the last digit and should have commas inserted where appropriate. 

The structure of the report should generally conform to the outline shown below but the exact placement of items is left to the discretion of the programmer.

                              CSIS Web Site
                          Evaluation Form Report

CountryName          Visitors       Occupation                 Evaluation
XXXXXXXXXXXXXXXXXXXX  XX,XXX  XXXXXXXXXXXXXXXXXXXXXXX           XXXXXXXXX
XXXXXXXXXXXXXXXXXXXX  XX,XXX  XXXXXXXXXXXXXXXXXXXXXXX           XXXXXXXXX
XXXXXXXXXXXXXXXXXXXX  XX,XXX  XXXXXXXXXXXXXXXXXXXXXXX           XXXXXXXXX
XXXXXXXXXXXXXXXXXXXX  XX,XXX  XXXXXXXXXXXXXXXXXXXXXXX           XXXXXXXXX
XXXXXXXXXXXXXXXXXXXX  XX,XXX  XXXXXXXXXXXXXXXXXXXXXXX           XXXXXXXXX
-----------------------------------------------------------------
Total Visitors           -      XXX,XXX
Overall Evaluation  - XXXXXXXXX