Computers and Technology

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()

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 08:00, dramaqueenactr2040
Two technicians are discussing the common u-joint. technician a says its input and output speeds should be equal. technician b says that it normally has two yokes. which technician is correct?
Answers: 1
image
Computers and Technology, 23.06.2019 12:50, tommy4260
Which syntax error in programming is unlikely to be highlighted by a compiler or an interpreter? a variable name misspelling a missing space a comma in place of a period a missing closing quotation mark
Answers: 1
image
Computers and Technology, 23.06.2019 15:00, MalikaJones
In the blank libreoffice writer document, to start the process of entering a date field into a letter, click on the insert menu. edit menu. file menu. fields menu.
Answers: 3
image
Computers and Technology, 23.06.2019 23:00, GreenHerbz206
Computer programming is one type of what career
Answers: 1
Do you know the correct answer?
Assignment Background Video games have become an outlet for artists to express their creative ideas...

Questions in other subjects:

Konu
Mathematics, 23.04.2021 18:10
Konu
Social Studies, 23.04.2021 18:10