lab 6 files earthquakes – Custom Nursing Help

lab 6 files earthquakes – Custom Nursing Help

[ad_1]

Assignment

  • Hint: You’ll be using file of comma separated values, yet a comma appears in one of the values itself (location.full field). That can mess up the split(‘,’) function because some of the values you need to use come after that location.full column, which has the occasional comma. The hint is to go at it from the other direction. None of the columns after the location.full field have commas in the values. Remember that you can use a negative number to index into a list from the other end rather than the beginning.
  • Download the file earthquakes.csv. This input file is described in detail here.
  • Download lab6.py into the same directory where the earthquakes.csv file is located and rename it according to the instructions in the Logistics section.
  • Implement the average_magnitude function such that it calculates and returns the average magnitude of the recorded earthquakes.
  • Implement the earthquake_locations function such that it identifies every unique location (use the name field in the file) and prints them in alphabetical order.
  • Implement the count_earthquakes function. The function should calculate the number of recorded earthquakes that have a magnitude greater than or equal to the low bound and less than or equal to the high bound. The user will specify the bounds and you may assume that the user will enter valid numbers.

Sample Run

  • In this sample run, the user inputs 5.0 for the lower bound and 6.0 for the upper bound.

Grading – 10 points

  • 2 points – The average_magnitude function is correct.
  • 3 points – The earthquake_locations function finds all of the unique locations (2 points) and prints each unique location once in sorted order (1 point).
  • 3 points – The count_earthquakes function is correct. The function will be tested on a different case that will be revealed after the lab is submitted.
  • 2 points – The format of the output matches exactly the format of the output transcript. For each type of difference, 1 point will be deducted.

Download LAB 6

# --------------------------------------_x000D_
# CSCI 127, Lab 6                      |_x000D_
# February 27, 2020                    |_x000D_
# Your Name                            |_x000D_
# --------------------------------------_x000D_
_x000D_
# The missing functions go here._x000D_
_x000D_
# --------------------------------------_x000D_
_x000D_
def main(file_name):_x000D_
    magnitude = average_magnitude(file_name)_x000D_
    print("The average earthquake magnitude is {:.2f}n".format(magnitude))_x000D_
    _x000D_
    earthquake_locations(file_name)_x000D_
    _x000D_
    lower_bound = float(input("Enter a lower bound for the magnitude: "))_x000D_
    upper_bound = float(input("Enter an upper bound for the magnitude: "))_x000D_
    how_many = count_earthquakes(file_name, lower_bound, upper_bound)_x000D_
    print("Number of recorded earthquakes between {:.2f} and {:.2f} = {:d}".format(lower_bound, upper_bound, how_many))_x000D_
_x000D_
# --------------------------------------_x000D_
 

main(“earthquakes.csv”)

 

Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code “Newclient” for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.

"96% of our customers have reported a 90% and above score. You might want to place an order with us."

Essay Writing Service
Affordable prices

You might be focused on looking for a cheap essay writing service instead of searching for the perfect combination of quality and affordable rates. You need to be aware that a cheap essay does not mean a good essay, as qualified authors estimate their knowledge realistically. At the same time, it is all about balance. We are proud to offer rates among the best on the market and believe every student must have access to effective writing assistance for a cost that he or she finds affordable.

Caring support 24/7

If you need a cheap paper writing service, note that we combine affordable rates with excellent customer support. Our experienced support managers professionally resolve issues that might appear during your collaboration with our service. Apply to them with questions about orders, rates, payments, and more. Contact our managers via our website or email.

Non-plagiarized papers

“Please, write my paper, making it 100% unique.” We understand how vital it is for students to be sure their paper is original and written from scratch. To us, the reputation of a reliable service that offers non-plagiarized texts is vital. We stop collaborating with authors who get caught in plagiarism to avoid confusion. Besides, our customers’ satisfaction rate says it all.

© 2022 Homeworkcrew.com provides writing and research services for limited use only. All the materials from our website should be used with proper references and in accordance with Terms & Conditions.

Scroll to Top