homework 11

Description

INTRODUCTION:

Don't use plagiarized sources. Get Your Custom Assignment on
homework 11
From as Little as $13/Page

You are working for the National Park Service at Mt. Rainier National Park in Washington state. Data has been collected dealing with daily snowfall amounts for the park at Paradise station, one of the snowiest places in the United States, as part of advertising to the public. You are required to develop a computer program that will perform snowfall averaging analysis. The input data file is called snowfall.txt. As you examine the input file, you notice that the record lines are the snowfall amounts: 4 rows (four weeks in December 2022) and 7 columns (one for each day of the week).

ASSIGNMENT:

Write a Python script that will read the data from the input file, such that the snowfall amounts are stored in a two-dimensional array. Manipulate the two-dimensional array to calculate the total snowfall for the month, the average snowfall for the month, and the average snowfall for each day of the week. Then find the minimum and maximum snowfalls and the locations in the array of the minimum and maximum values (finding the first instance of each is OK). Finally, count how many days with above-average snowfall occur (use average snowfall for the month to determine this) and how many days occur with no measured snowfall.

Most of your code will likely be in the main() function. You’ll have a separate user-defined function to verify the input file is at the specified path. Other functions are up to your discretion.

Print the output to the computer screen and to an output file called snowfall_report. Illustrated below is the output style for the computer screen and the output file.

OUTPUT FORMAT:

****************************************************

MT. RAINIER NATIONAL PARK – DECEMBER 2022 SNOWFALL

Day1 Day2 Day3 Day4 Day5 Day6 Day7

Week 1 xx.x xx.x xx.x xx.x xx.x xx.x xx.x

Week 2 . . . . . . .

Week 3 . . . . . . .

Week 4 . . . . . . .

Avg: xx.x xx.x xx.x xx.x xx.x xx.x xx.x

REPORT SUMMARY:

Minimum snowfall is xx.x inches in week xx, day x.

Maximum snowfall is xx.x inches in week xx, day x.

There are xx days with above-average snowfall.

There are xx days with no measured snowfall.

****************************************************

SUBMITTING ASSIGNMENTS:

Once you have your program working, exit the Python IDE that you are using. Make sure that your source program file name conforms to the following specifications:

sn_pn_first_last

where: sn is your section number (01, 02, 03, …)

pn is the program number (11)

first is your first name

last is your last name

An example for the tenth coding assignment would be 1_11_elmer_fudd.py.

Submission:

Submit both your handwritten problem-solving process and your Python source code using the Assignments button in Blackboard. Remember to submit your Python source program in Python 3 only, using code as demonstrated in class. No other format will be accepted.

If you make changes to your program and need to resubmit, rename the file such as 1_11_elmer_fudd_2.py or 1_11_elmer_fudd_3.py, etc. Then use the Assignments button in Blackboard to submit the new version. Only the most current submitted program version will be graded.

FILE PATHS:

Files on the grader’s computer and Dr. B.’s computer will be located at:
C:ENGR 200snowfall.txt and C:ENGR 200snowfall_report.txt


Unformatted Attachment Preview

ENGR 200
FALL 2023
HOMEWORK 11: SNOWFALL ANALYSIS
(input/output files, if structures, for loops, NumPy, two-dimensional array)
DUE: November 17, 2023, at 11:59 p.m. US Central Time
POINTS: 80
INTRODUCTION:
You are working for the National Park Service at Mt. Rainier National Park in Washington state. Data has been
collected dealing with daily snowfall amounts for the park at Paradise station, one of the snowiest places in the
United States, as part of advertising to the public. You are required to develop a computer program that will
perform snowfall averaging analysis. The input data file is called snowfall.txt. As you examine the input file,
you notice that the record lines are the snowfall amounts: 4 rows (four weeks in December 2022) and 7 columns
(one for each day of the week).
ASSIGNMENT:
Write a Python script that will read the data from the input file, such that the snowfall amounts are stored in a
two-dimensional array. Manipulate the two-dimensional array to calculate the total snowfall for the month, the
average snowfall for the month, and the average snowfall for each day of the week. Then find the minimum and
maximum snowfalls and the locations in the array of the minimum and maximum values (finding the first
instance of each is OK). Finally, count how many days with above-average snowfall occur (use average
snowfall for the month to determine this) and how many days occur with no measured snowfall.
Most of your code will likely be in the main() function. You’ll have a separate user-defined function to verify
the input file is at the specified path. Other functions are up to your discretion.
Print the output to the computer screen and to an output file called snowfall_report. Illustrated below is the
output style for the computer screen and the output file.
OUTPUT FORMAT:
****************************************************
MT. RAINIER NATIONAL PARK – DECEMBER 2022 SNOWFALL
Day1
Day2
Day3
Day4
Day5
Day6
Day7
Week 1 xx.x
Week 2 .
Week 3 .
Week 4 .
xx.x
.
.
.
xx.x
.
.
.
xx.x
.
.
.
xx.x
.
.
.
xx.x
.
.
.
xx.x
.
.
.
Avg:
xx.x
xx.x
xx.x
xx.x
xx.x
xx.x
xx.x
REPORT SUMMARY:
Minimum snowfall is xx.x inches in week xx, day x.
Maximum snowfall is xx.x inches in week xx, day x.
There are xx days with above-average snowfall.
There are xx days with no measured snowfall.
****************************************************
SUBMITTING ASSIGNMENTS:
1
Once you have your program working, exit the Python IDE that you are using. Make sure that your source
program file name conforms to the following specifications:
sn_pn_first_last
where:
sn is your section number (01, 02, 03, …)
pn is the program number (11)
first is your first name
last is your last name
An example for the tenth coding assignment would be 1_11_elmer_fudd.py.
Submission:
Submit both your handwritten problem-solving process and your Python source code using the
Assignments button in Blackboard. Remember to submit your Python source program in Python 3 only, using
code as demonstrated in class. No other format will be accepted.
If you make changes to your program and need to resubmit, rename the file such as 1_11_elmer_fudd_2.py or
1_11_elmer_fudd_3.py, etc. Then use the Assignments button in Blackboard to submit the new version.
Only the most current submitted program version will be graded.
FILE PATHS:
Files on the grader’s computer and Dr. B.’s computer will be located at:
C:ENGR 200snowfall.txt and C:ENGR 200snowfall_report.txt
2
0.0 32.0 3.0 3.0 0.0 5.0 1.0
0.0 12.5 17.0 1.0 0.0 0.5 0.0
0.0 0.0 0.0 1.0 7.5 0.0 0.0
18.0 2.5 0.0 0.0 0.4 2.5 17.5

Purchase answer to see full
attachment