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, 22.06.2019 06:30
Selective incapacitation is a strategy to reduce prison population
Answers: 3
question
Computers and Technology, 22.06.2019 19:30
Singing in the rain: this first part of the film shows the early history of motion picture. how accurate do you think the portrayal of the early motion picture industry is? why? is historical accuracy important in films and theater productions? explain.
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
What are ways to switch windows in excel? check all that apply. on the status bar, click the windows button, and then click the file name. on the task bar, click to display the excel jump list, and then click the file name. on the view tab, in the window group, click switch windows, and then click the file name. on the review tab, in the viewing group, click files, and then click the file name.
Answers: 1
question
Computers and Technology, 23.06.2019 23:30
The keyboard usually has six rows of keys. which of the following is not one of the key group categories? letter keys number keys control keys graphic keys
Answers: 1
You know the right answer?
Assignment Background Video games have become an outlet for artists to express their creative ideas...
Questions
question
Mathematics, 11.07.2019 01:10
Questions on the website: 13722362