Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python code Assume you are working for an online book seller. Your company tracks the number of books sold by a particular author. Your job

image text in transcribed

python code

Assume you are working for an online book seller. Your company tracks the number of books sold by a particular author. Your job is to find the author whose books were the best sellers (most books sold), and the average number of books sold. You can assume the data file looks like the following: Author, books-sold Shakespeare, 2339 Hemingway,3298 Twain, 3117 Woolfe, 4322 Morrison, 5223 Atwood, 2993 Below is some skeleton code for the functions of this program. Write the code for TWO of the functions in the program. You can choose which functions to fill in. Also write the main function that calls these functions. # # Given: A .csv file with author names and number of books # sold for each author. # Find: The name of the author with the most books sold # and the average number of books sold. name # Function to get the data from the file given the file na def getData (fname) : # Return the lists # Function to find the author with the most books sold def mostBooks (authorList, soldlist): # Return the name of the author with the most books sold # Function to compute the average number of books sold def computeAverage (soldList): # Return the average number of books sold

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

Temporal Databases Research And Practice Lncs 1399

Authors: Opher Etzion ,Sushil Jajodia ,Suryanarayana Sripada

1st Edition

3540645195, 978-3540645191

More Books

Students also viewed these Databases questions