Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hello! I really need help with this homework assignment! Thanks for the help. Python Programming Assignment In this comprehensive programming assignment, you will combine the
Hello! I really need help with this homework assignment! Thanks for the help.
Python Programming Assignment In this comprehensive programming assignment, you will combine the various components of the Python programming language that you learned this semester. The program will be based on obscrvations of earthquakes. The earthquake data that you will be processing is real data in csv format from the following site: https://earthquake.usgs gov/earthquakes/feed/.0/esv-php The description of the data can be found on that site but the fields of interest for this program include: date TimeZ is a String representing the dateTime of the earthquake. (String: 24 characters in the format yyyy-mm-ddT##: #######Z) latitude must be a valid latitude value (decimal: -90 to 90) longitude must be a valid longitude value (decimal: -180 to 180) magnitude represents the magnitude of the earthquake (decimal: -1.0 to 10.0) id is the unique id assigned to the earthquake (String) place is the location of the earthquake (String) . Based on the values of the earthquake observations, an Earthquake will be created as either NonClassified (magnitude 3) or Classified (see the following table, indicating the classification of the earthquake magnitude). Note that the UML specification of the classes is provided in a figure below using Java types. Minor Light Moderate Strong Major Great Magnitude3-3.9 4-4.9 5-5.9 6-6.9 7-7.9 8 or more The earthquaketester py file MUST incorporate the following components: Prompt the user for a filename, incorporating exception handling until the user enters a valid file above, maintainin g a collection of earthquake Process the file by creating e objects that are classified or nonclassified [Collection type is your implementation decision] Hint: Use csv.DictReader0 and verify that data row represents an "earthquake" see ope field. OUTPUTThe number of Classified Earthquakes, NonClassified Earthquakes, & Non-Earthquakes Classfied Earthquakes: Create a dictionary of classified carthquakes by magnitude class. OUTPUT-The magnitude class with count, eg. Great: # with highest magniture first and then on subsequent lines, the string representation of the earthquake sorted in reverse chronological order Hint: Use lambda function for key of sorted function. NonClassified Earthquakes: OUTPUT> Display the maximum and minimum magnitude values. Non-Earthquakes: OUTPUT> Display the names of types in the data file that are not earthquakes. ALL Earthquakes: Create a dictionary based on the place field. Specifically, the key for the dictionary is the value occuring after the final comma (,") in that data field. ignoring leading trailing spaces. Teis list of carthquake objects OUTPUT-The place key with count, eg. Alaska: # and then on subsequent lines, the string representation of the carthquake sorted such that the earthquake with the highest magnitude is listed first. Hint: Use lambda fiunction for key of sorted fiunction
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started