Project for Computer Programming
The grade of your project is determined by the followings: – Design (20%)
– Programming Style (20%): Style and efficiency of your program (comments are expected in the source code).
– Correctness (30%): We will verify the correctness of your program by testing it through – Final Report (30%): The report includes the features of your system, a brief user manual of
your system as well as the source codes of your system.
Specifications
1. The World Health Organization (WHO) compiles data about immunization levels around the world. The file named “measles.txt” contains data about the level of measles vaccinations in various countries over time.
Each line of the file contains the following fields, where there is one space between fields:
Country (50 characters)
Income Level (6 characters) Percent Vaccinated (3 characters) Region (25 characters)
Year (4 characters)
The “Country” field contains the name of the country.
The “Income Level” field identifies the category assigned to that country by the World Bank:
WB_LI low income WB_LMI lower middle income WB_UMI upper middle income WB_HI high income
The “Percent Vaccinated” field contains an integer number representing the percentage of children in that country who have received measles vaccine by the age of one.
The “Region” field identifies the region assigned to that country by WHO. The “Year” field contains the year for which the data was compiled.
Implementation
1. Your program will display one summary report to the user.
a) The program will always read from “measles.txt” (it will not prompt the user for the name of the input file). If it is unable to open that file, the program will halt.
b) The program will prompt the user to enter a year, and will then prompt the user to enter an income level. The income level must be one of the characters in the set {1, 2, 3, 4}, where 1 corresponds to “low income”, 2 corresponds to “lower middle income”, 3 corresponds to “upper middle income” and 4 corresponds to “high income”.
c) The program will identify all records (lines) in the input file which match the user’s criteria for year and income level, and the program will display a report with the following information:
The count of records in the input file which match the user’s criteria
The average percentage for those records (displayed with one fractional digit) The country with the lowest percentage for those records
The country with the highest percentage for those records
The name of the country and the percent of children vaccinated will be displayed for the last two items (lowest percentage and highest percentage).
2. The program will display appropriate messages to inform the user about any unusual circumstances.