Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

*In Python* For this assignment, you will use the weather.txt file linked under this week's module. This assignment requires you to turn in one script.

*In Python*

For this assignment, you will use the weather.txt file linked under this week's module. This assignment requires you to turn in one script. You can receive partial credit for each part you complete even if you don't get the final script working. However, you MUST turn in a working script to receive the full points for a given part. If your script does not run, you will receive less credit. You also must complete the parts in order. For example, if you do not have part 2 working correctly, you will not receive any points for part 3. Do not move on to a part until you have all the previous parts working.

Parts:

  1. Your script must read in the weather file and split each line into its component parts. To receive credit for this part only, print out the date and the temperature for each day. (2 points)
  2. Create a class WeatherObservation. It should have a working __init__ function (1 point)
  3. Each instance of WeatherObservation corresponds to a row of data in the weather file. Each instance should have a date, temperature, pressure, humidity, and wind speed value. Adapt your __init__ function to take these values as arguments and set variables for each instance equal to the values passed in (2 points)
  4. Your WeatherObservation class should have a function printObservation() that will print all the data from #3 for a given weather observation (1 point)
  5. Building on #1, after splitting up each line, create a WeatherObservation object to store the information in the appropriate attributes (1 point)
  6. Create a list that stores ALL the weather observations you create. You should create one WeatherObservation per line in the weather file (1 point)
  7. Print out the average temperature, pressure, humidity, and wind speed calculated over all the data. You must use the WeatherObservation instances you created to do this (1 point)
  8. Find the date with the maximum temp, max pressure, max humidity, and max wind speed. You should find 4 dates (one for temp, one for pressure, etc). For each date, print the day's full info using the printObservation() function (1 point)

weather.txt: https://drive.google.com/file/d/1Mi_jvon97kZkvM1C1009LcNEiJhq2Ar3/view?usp=sharing

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Oriented Databases Prentice Hall International Series In Computer Science

Authors: John G. Hughes

1st Edition

0136298745, 978-0136298748

More Books

Students also viewed these Databases questions

Question

What can you do if your credit application is denied?

Answered: 1 week ago

Question

a. How do you think these stereotypes developed?

Answered: 1 week ago

Question

7. Describe phases of multicultural identity development.

Answered: 1 week ago