IUP Computer Science
COSC 110   Fall 2006

Project #6
(Ozone Alerts)
(Due 8 December 2006)

Officials in the city of London have long been concerned with the level of ozone and other air pollutants.  Several years ago, they established 22 air quality monitoring stations, one in each of the 22 sections of central London.  Each month from April to September, readings are collected from these stations and put into files for computer analysis.  The files for 2006 are named Apr06.txt, May06.txt, ... Sep06.txt  (each named using the first three letters of the month followed by 06.txt).  All six files can be found on the I: drive at  I:\jlwolfe\110  The form of each file is the same; each line contains the section's name followed by one ozone reading (in parts per billion) for each day of the month.  Here are the first few lines from the Apr06.txt file.  Naturally for April, there are 30 readings for each station; so they wrap around in this printout; but they are actually on one line in the file.

Whitechapel  60  41  41  42  80  47  23  11  21  25  41  12  63  16  18  47  97
 93  93  50  13  91  69  18   9  31  15  12  42   9
Bermondsey   14  23  35  41  44   8  43  26  56  21  23  15  37  41   6  26  14
 27   8  27  69  37   7  11  12  21   5  36  22  33
Walworth     23  31  26  38  26  20  27  17  41   9  19  19  52  30  69  13  48
 22  23  26  44  12   8  34  14  62   5  45   7  89

You are to write a program that allows the person at the keyboard to specify which of the monthly 2006 files to use and then generates a report file about the readings for the month.  Because this is a  government report, the specifications as to how it works are quite rigid.  Your program must do the following things:
 

  1. It must prompt for the month to be specified as a 3-letter name.  This must be the only prompt.  Using the three-letter name, the program must determine which file to read and it must determine the name of the report file to write.  The report files are to be named  Apr06report.txt, May06report.txt, ... Sep06report.txt, corresponding to the months.
  2. The report file must contain a header line containing the name of the month.
  3. This is followed by a display of any sections of London that had high ozone levels for three or more days in a row.  The display must show the section's name and the first and last day number of the high ozone level series.  A high ozone level is any reading above 84 parts per billion.
  4. This display is followed by a table of sections with a list of days that had very unhealthy ozone levels.  Only sections that had very unhealthy days are in the table.  The list shows the section name and for each unhealthy day shows the day number followed by the actual reading in parentheses.  A reading of 105 or higher is regarded as very unhealthy.
  5. Finally, the report must list which days of the month had a good ozone level in all 22 sections.  A good level is a reading below 65 parts per billion.
If you want to add extra credit to your project, you may add one or both of the following components to the report file.  These two items are both optional.
  Below is a printout of the report file for April.  It includes all of the required elements, as well as the extra credit elements.

Report for the month of Apr

Bad series in Whitechapel from 17 to 19
Bad series in Kennington from 20 to 23
Bad series in Bloomsbury from 24 to 26

Very Unhealthy Days
Section        Day(Reading)
Kennington       23(112)
Hoxton            3(119)  30(109)
Clerkenwell       4(116)
Soho              3(109)
Westminster      26(112)  30(107)
Paddington       24(106)
Brompton          5(109)  23(108)
Chelsea           7(106)

Good Days, Low Ozone Levels in ALL Sections
   1   2  10  11  12  14  27  28

Generally Unhealthy Days
Day 30, high ozone levels in 5 sections

Highest ozone day was 30 with an average of 47.4091

Your program is required to include at least two functions, other than main.  You may choose from among the various tasks what you want to make into a function.  I really recommend using more than two  functions; but at least two are required.

Approximately three days before the project is due, I will specify which of the months I want you to create a report file for.  Create a folder named P6 in your folder on the P: drive for COSC 110, not in the handin folder.  Copy into this folder your program file (the .cpp file named after yourself) and the report files that I request.  Hand in a well documented printout of your program.  You are not required to print the output files.