Part 1

Create a GUI that has two Buttons, a Text Box, and a Label like:see image.

Also use try..except to display an error if the file does not exist. Give an appropriate error message.

For this project, we will be doing a Control Break report (both text and HTML versions).

1. Write OH Water Use Report

The first two rows of the data file are:

state_cd,state_name,county_cd,county_nm,year,"Total Population total population of area, in
thousands","Public Supply population served by groundwater, in thousands"
2s,40s,3s,40s,4s,16s,16s

The first row (shown here as two rows with wraparound) contain the heading for each field. The second shows field width. You will need to use the .readline() method to read past these two lines to get to the data. As you do your Control Break logic, open the file and read one line at a time (the .readline() method will be helpful). The .readline() method is described on p. 122. Look at what is returned if end of file is found. This is a hint. Do NOT use lists to store all your data but process each line as you get it. You can use a list for each line as you process it. Also, do NOT use the .read() command to read in all the data at once. Your program needs to work for any data file with the format shown above, not just for this data. Also, the data is grouped by date within county. Do a control break on county name. When the county name changes, display the county statistics for the county just completed. Your program needs to be independent of the data in the file (e.g. the county names should not be in the program).

Here is output from the data file:

Water Report for Selected OH Counties – 1985 to 2010

Adams County
Year Population Ground Water Surface Water
1985 24.700 15.470 0.000
1990 25.370 19.400 0.000
1995 27.670 21.030 0.000
2005 28.454 25.009 0.000
2010 28.550 27.710 0.000
2015 28.024 27.184 0.000

Average Population 1985 to 2015 of Adams County is 27.13 (in thousands)
Average Population served by Ground Water 1985 to 2015 of Adams County is 22.63 (in thousands)
Average Population served by Surface Water 1985 to 2015 of Adams County is 0.00 (in thousands)

Ashland County
Year Population Ground Water Surface Water
1985 46.400 26.180 0.530
1990 47.510 28.210 0.820
1995 51.240 30.320 0.940
2000 52.523 25.706 1.800
2005 54.123 26.011 0.450
2010 53.139 26.206 1.522
2015 53.213 25.413 0.450

Average Population 1985 to 2015 of Ashland County is 51.16 (in thousands)
Average Population served by Ground Water 1985 to 2015 of Ashland County is 26.86 (in thousands)
Average Population served by Surface Water 1985 to 2015 of Ashland County is 0.93 (in thousands)

Ashtabula County
Year Population Ground Water Surface Water
1985 101.700 3.190 68.410
1995 102.360 7.460 75.450
2000 102.728 7.300 73.300
2005 103.221 2.690 71.650
2015 98.632 3.059 79.469

Average Population 1985 to 2015 of Ashtabula County is 101.73 (in thousands)
Average Population served by Ground Water 1985 to 2015 of Ashtabula County is 4.74 (in thousands)
Average Population served by Surface Water 1985 to 2015 of Ashtabula County is 73.66 (in thousands)

Athens County
Year Population Ground Water Surface Water
1985 58.000 24.880 21.820
1990 59.550 23.000 27.460
1995 60.690 23.730 27.860
2000 62.223 41.730 11.004
2005 62.062 42.655 9.607
2010 64.757 46.750 8.654
2015 65.886 51.595 0.000

Average Population 1985 to 2015 of Athens County is 61.88 (in thousands)
Average Population served by Ground Water 1985 to 2015 of Athens County is 36.33 (in thousands)
Average Population served by Surface Water 1985 to 2015 of Athens County is 15.20 (in thousands)

Coshocton County
Year Population Ground Water Surface Water
1985 36.400 18.550 0.000
1990 35.420 19.860 0.090
1995 36.240 20.090 0.200
2000 36.655 21.137 0.086
2005 36.945 20.476 0.000
2010 36.901 18.038 0.061
2015 36.569 14.838 0.000

Average Population 1985 to 2015 of Coshocton County is 36.45 (in thousands)
Average Population served by Ground Water 1985 to 2015 of Coshocton County is 19.00 (in thousands)
Average Population served by Surface Water 1985 to 2015 of Coshocton County is 0.06 (in thousands)

Franklin County
Year Population Ground Water Surface Water
1985 893.800 41.260 852.540
1990 961.440 143.080 818.350
1995 1011.020 151.650 859.370
2000 1068.978 46.515 1018.195
2005 1090.771 151.112 932.258
2010 1163.414 138.746 1017.644
2015 1251.722 52.029 1192.693

Average Population 1985 to 2015 of Franklin County is 1063.02 (in thousands)
Average Population served by Ground Water 1985 to 2015 of Franklin County is 103.48 (in thousands)
Average Population served by Surface Water 1985 to 2015 of Franklin County is 955.86 (in thousands)

Muskingum County
Year Population Ground Water Surface Water
1985 84.200 53.780 7.460
1990 82.070 60.620 6.200
1995 84.170 62.040 6.140
2000 84.585 62.946 7.529
2005 85.579 64.605 8.366
2010 86.074 66.314 9.092
2015 86.290 61.086 9.057

Average Population 1985 to 2015 of Muskingum County is 84.71 (in thousands)
Average Population served by Ground Water 1985 to 2015 of Muskingum County is 61.63 (in thousands)
Average Population served by Surface Water 1985 to 2015 of Muskingum County is 7.69 (in thousands)

Noble County
Year Population Ground Water Surface Water
1985 11.300 0.000 6.620
1990 11.340 0.000 6.520
1995 12.100 0.000 6.890
2000 14.058 0.000 9.168
2005 14.156 0.000 10.659
2010 14.645 0.000 13.829
2015 14.326 0.000 13.829

Average Population 1985 to 2015 of Noble County is 13.13 (in thousands)
Average Population served by Ground Water 1985 to 2015 of Noble County is 0.00 (in thousands)
Average Population served by Surface Water 1985 to 2015 of Noble County is 9.64 (in thousands)

Sandusky County
Year Population Ground Water Surface Water
1985 62.200 6.520 26.400
1995 63.000 6.680 26.710
2005 61.676 5.374 25.584
2015 59.679 5.481 24.644

Average Population 1985 to 2015 of Sandusky County is 61.64 (in thousands)
Average Population served by Ground Water 1985 to 2015 of Sandusky County is 6.01 (in thousands)
Average Population served by Surface Water 1985 to 2015 of Sandusky County is 25.83 (in thousands)

Stark County
Year Population Ground Water Surface Water
1985 377.300 240.710 28.000
1990 367.580 258.890 25.000
1995 375.550 263.150 26.030
2000 378.098 273.755 25.000
2005 380.608 266.239 23.000
2010 375.586 254.226 23.000

Average Population 1985 to 2015 of Stark County is 375.79 (in thousands)
Average Population served by Ground Water 1985 to 2015 of Stark County is 259.50 (in thousands)
Average Population served by Surface Water 1985 to 2015 of Stark County is 25.00 (in thousands)

Washington County
Year Population Ground Water Surface Water
1985 64.800 50.200 0.000
1990 62.250 52.120 0.000
1995 63.840 53.620 0.000
2000 63.251 54.137 0.000
2005 62.210 60.821 0.000
2010 61.778 60.820 0.000
2015 61.112 60.514 0.000

Average Population 1985 to 2015 of Washington County is 62.75 (in thousands)
Average Population served by Ground Water 1985 to 2015 of Washington County is 56.03 (in thousands)
Average Population served by Surface Water 1985 to 2015 of Washington County is 0.00 (in thousands)
Number of rows found: 70
Number of counties found: 11

Part 2. Write OH Water Use Report to HTML

Use the same logic as Write OH Water Use Report but instead of writing the data so the screen, write the file to an html file. In this case you will open the original water file again but this time use html tags (like < html > < title > < /title > < /html >). Allow the user to enter the point size and display the data using that point size. Also, the main heading will be in Green and the column heading will be in Red. I'll talk more about this in class. This file should be created with an htm extension and should be able to be read by a browser. Refer to the w3schools.com site for more information on html.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.