subject

Assignment Background Video games have become an outlet for artists to express their creative ideas and imaginations and a great source of entertainment for people who seek a fun and accessible ways to immerse in unique worlds while also share and interact with others. This project will print video game sales data for various platforms across the years. From the old school consoles like Atari 2600 and Sega Genesis to more modern ones like the Xbox One and PlayStation 4. Project Specifications You must implement the following functions: open_file() → file pointer: a. This function repeatedly prompts the user for a filename until the file is opened successfully. An error message should be shown if the file cannot be opened. It returns a file pointer. Use try-except and FileNotFoundError to determine if the file can be opened. Use the 'utf-8' encoding to open the file. fp = open (filename, encoding ='utf-8') b. Parameters: none c. Returns : file pointer main () : a) This function is the starting point of the program. The program starts by opening the file with the video game sales and reading the data into three dictionaries. The program will repeatedly prompt the user to select an option from the following menu: i. Option 1: Display the global sales for all video game titles across multiple platforms in a single year. Prompt for a year (validation is required!, year needs to be an int), get the data by calling the get_data_by_column function, and then display the selected year's data if the year exists in the data. Prompt the user whether they want to plot the data. If the answer is "y", use plot_global_sales ( ) to plot the histogram of the total global sales per publisher. ii. Option 2: Display the global sales for all video game titles across multiple years in a single platform. Prompt for a platform (validation is required!, cannot be a number) ), get the data by calling the get_data_by_column function, and then display the selected platform data if the platform exists in the data. Prompt the user whether they want to plot the data. If the answer is "y", get lists to plot by calling the get_totals function, and then use plot_global_sales () to plot the histogram of the total global sales per year. iii. Option 3: Display the regional sales for all video game genres. Prompt for a year (validation is required!, year needs to be an int), call get_genre_data, and then display the selected year data if the year exists using display_genre_data. Prompt the user whether they want to plot the data. If the answer is "y", call prepare_pie to get the lists to plot, and then use plot_genre_pie () to plot a pie chart of the total global sales per genre. iv. Option 4: Display the regional sales for all the video games by publisher. Prompt the user for a keyword in the publisher. Search for all publishers who have that keyword as a substring, then display the results. If there are multiple publisher names with the same string, enumerate all possible names. The publisher names should appears alphabetically because they were read into the dictionary that way; if not, sort them. Use the following string formatting: "{:<4d}{}", format (index, publisher) " Your header goes here import csv import pylab from operator import itemgetter def open_file(): WRITE DOCSTRING HERE! pass def read_file(fp): WRITE DOCSTRING HERE! pass def get_data_by_column (D1, indicator, c_value): WRITE DOCSTRING HERE! pass def get_publisher_data (D3, publisher): WRITE DOCSTRING HERE! pass def display_global_sales_data(L, indicator): WRITE DOCSTRING HERE! header1 = ['Name', 'Platform', 'Genre', 'Publisher', 'Global Sales'] header2 = ['Name', 'Year', 'Genre', 'Publisher', 'Global Sales'] pass def get_genre_data(D2, year): WRITE DOCSTRING HERE! pass def main(): # Menu options for the program MENU = '''Menu options 1) View data by year 2) View data by platform 3) View yearly regional sales by genre 4) View sales by publisher 5) Quit Enter choice: ". while choice != '5': #Option 1: Display all platforms for a single year try: #if the list of platforms for a single year is empty, show an error message pass except ValueError: print("Invalid year.") #Option 4: Display publisher data # Enter keyword for the publisher name # search all publisher with the keyword match = [] # print the number of matches found with the keywords if len (match) > 1: print("There are {} publisher(s) with the requested keyword!".format(len(match))). for i, t in enumerate (match): print("{:<4d}{}".format(i, t[0])) # PROMPT USER FOR INDEX else: index = 0 choice = input (MENU) print("\nThanks for using the program!") print("I'll leave you with this: "All your base are belong to us!"") if == "_main ": name main()

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 16:40
Match each feature of e-publishing as an advantage, a disadvantage, a threat, or an opportunity. (choices) increased collaboration digitalized out-of-print versions monopoly over digital formats requirement for a specialized digital device pairs advantage of e-publishing disadvantage of e- opportunity for e- threat to e-
Answers: 1
question
Computers and Technology, 23.06.2019 02:30
Experimental data that is expressed using numbers is said to be
Answers: 1
question
Computers and Technology, 23.06.2019 05:20
What did creator markus “notch" persson initially call his game
Answers: 1
question
Computers and Technology, 23.06.2019 08:00
The managing director of a company sends a christmas greeting to all his employees through the company email. which type of network does he use? he uses an .
Answers: 3
You know the right answer?
Assignment Background Video games have become an outlet for artists to express their creative ideas...
Questions
question
Biology, 25.07.2020 01:01
question
Mathematics, 25.07.2020 01:01
Questions on the website: 13722360