I would also like an explanation, thank you
CSC 1301 – SPRING 2023 Homework #03 Due 04/04/2023 11.59 pm Building a Team Roster Note about collaboration: For this homework, you are required to Work by yourself. No Partners allowed. All program source code and designs will be checked for similarity. If similarity is found, it will be investigated for plagiarism. Assignment total points = Design (20 points) + Runs given test cases successfully (30 points) + Implementation correctly written (55 points) = 105 points Problem Description: For this assignment, we are going to build a roster management for the Atlanta Braves(World series Champions). Each players will have some stats that we are going to store. For simplicity, we will store only batter stats. For batters: AB(At bat), R(run), H(hits), HR(Home run), AVG(batting average) A roster could look like this: { “Austin Riley”: “AB: 615, R: 90, H: 168, HR: 38, AVG: 0.273”, “Ronald Acuna”: “AB: 467, R: 71, H: 124, HR: 15, AVG: 0.266”, ... } We want to allow user to 1) lookup a player stats, 2) add a player in the roster with stats about them 3) remove a player from the roster *** Braves Stats *** Welcome to My Braves Stats! What can I do for you? 1. Search for a player 2. Add a new player 3. Remove a player Please type your choice number: 1 Enter the name of the player you want to look up: Austin Riley Here’s are Austin stats: AB: 615, R: 90, H: 168, HR: 38, AVG: 0.273 Thanks for using My Braves Stats. .... *** Braves Stats *** Welcome to My Braves Stats! What can I do for you? 1. Search for a player 2. Add a new player 3. Remove a player Please type your choice number: 3 Enter the name of the player you want to remove: Mike Trout uh typo? Mike does not play for us:) ... *** dictionary *** Welcome to My Braves Stats! What can I do for you? 1. Search for a player 2. Add a new player 3. Remove a player Please type your choice number: 2 Enter the name of the player you want to add: Matt Olson Please add Matt’s stats: AB: 611, R: 84, H: 146, HR: 33, AVG: 0.239 Here’s the complete team roster: Austin Riley: AB: 615, R: 90, H: 168, HR: 38, AVG: 0.273, Ronald Acuna: AB: 467, R: 71, H: 124, HR: 15, AVG: 0.266, Matt Olson: AB: 611, R: 84, H: 146, HR: 33, AVG: 0.239 Test Plan (30 points) We have shared with you a file that contains testing component (we will be using the unit test library for this hw). You will write your solution in this file and check your logic by passing the test cases. This file contains test cases that will be run with your code(DO NOT MODIFY THE CODE IN THE TestDictFunctions class). To get all credits, make sure your code passes all test cases. There will be no screenshot/Working by hand test case for this homework. There are 6 test cases each worth 5 points. If you write your code in a way such that it works ONLY for test cases, you may not receive any points for this section. NOTE: This is the only file you will need to submit for this assignment. To run the tests, uncomment the line unitest.main(). The results of the test-cases will then be displayed in the terminal. (20 points) Design: Write the design for the program in pseudocode as comments in your main file NOTE: DO NOT create new file for this ● Give the three P's (purpose, pre- and post-conditions) and author info as usual. The steps do NOT have to be numbered. · # supply program prolog (3 P's) · # main function · # Display introductory message · Your design here (50 points) Implementation: Specifications for the implementation: ● Use the test cases as a starter on how to approach your implementation and improve your design ● Make sure that you create the appropriate functions with matching names as the functions in the test files. Think about return values of functions as well. What should be the appropriate return value of the add_to_dict() function so that I can pass the test cases. ● This program uses input; you will have to prompt the user for the inputs. The inputs can be assumed to be always be of the appropriate type ● Points will be exclusively given for good formatting and good user interaction for your program.(5 pts) ● You will have to print a dictionary for some part of this assignment, feel free to just print the dictionary without any formatting, if you know and can use loop for this feature, please do. This might help you link (5 bonus pts) ● Think about those different edges cases 1. What should you do if a user enter “5” when they should enter a number between 1 and 3 for their selection 2. What should your lookup function return when a user lookups a player that is not in your dictionary(Hint: look at test cases) 3. What should you do when a user adds a player that already exist in your roster(Hint: look at test cases) 4. what should you do when user tries to remove a player that is not in the team roster(Think about what you should print in the console here) Hints • There are at least three required functions that needs to be implemented for all test cases to pass o lookup_layer returns: string, accept: dict and string o add_player_to_dict returns: dict, accept: dict, string and string o delete_in_dict returns: dict, accept: dict and string • The main function should contain the logic of your program and call the three functions listed above. https://thispointer.com/python-4-ways-to-print-items-of-a-dictionary-line-by-line/