Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please code in python and in beginner/ simplest way! thank you. will for sure thumbs up!! cvs file: A project to manage a baseball team's

Please code in python and in beginner/ simplest way! thank you. will for sure thumbs up!!

image text in transcribedimage text in transcribedimage text in transcribed

cvs file:

image text in transcribed

A project to manage a baseball team's information (1) Create a program that lets the manager of a baseball team track the data for each player and display the lineup for a baseball game. (2) Store the data in a text file that is loaded when the program starts. Sample Console Output +++++++ +++++++++++++++++ Baseball Team Management Program MENU OPTIONS 1 - Display lineup 2 - Add player 3 - Remove player 4 - Move player 5 - Edit player position 6 - Edit player stats 7 - Exit program POSITIONS C, 1B, 2B, 3B, SS, LE, CF, RF, P +++++++++++++ ++++ +++++++++++++++ Menu option: 2 Name : Mike Position: o At bats: 11 Hits: 4 Mike was added Menu option: 1 Player POS AB AVG 1 2 3 4 5 6 7 8 9 Trevor Garrett Tony Hunter Ian Nolan Daniel David Phillip SS 2B RF CF 3B 1B LE P 588 299 535 580 443 588 430 374 102 173 74 176 182 113 185 129 113 12 0.294 0.247 0.329 0.314 0.255 0.315 0.3 0.302 0.118 Menu option: 3 Enter a lineup number to remove: 10 Mike was deleted. Menu option: 4 Enter a current lineup number to move: 8 Jarrett was selected. Enter a new lineup number: 2 Jarrett was moved. Menu option: 5 Enter a lineup number to edit: 1 You selected Joe POS=2B Enter a new position: ss Joe was updated. Menu option: 7 Bye! PART 1 Create a program that manages a team by storing data in a list of players. The list will be stored in the main method. Use a list of lists to store each player in the lineup. The list for a single player includes their name, position, at bats, and hits. Example list with two players: lineupList = [[Trevor, 'SS', '588', '173'), (Garrett', '2B', '299', '74']] For part 1 this list will be declared with a statement in the main method. . Use functions to organize the code making it reusable, easy to read, and easy to maintain. Each of the functions for the six main menu commands should take the list of players as an input parameter. . . Use a tuple to store all valid positions (C, 1B, 2B, etc). When entering/editing positions, the program should always require the user to enter a valid position. The formula for calculating batting average is: average - hits/at_bats The program should round the batting average to a maximum of three decimal places. . . If the user enters an invalid menu option, display an error message, and display the menu again so the user can clearly see the valid menu options. Make sure the user can't enter data that doesn't make sense (such as a negative number of hits or the player having more hits than at bats). Handle the exceptions that occur if the user enters a string where an integer is expected. Handle the exception that occurs if the user enters zero for the number of at bats. . PART 2 Use the BaseballPlayers.csv file that is on the assignment page as the source for the lineup. Store the functions for writing to and reading from the file of players in a separate module named Filelo.py. Use the csv module for file I/O operations. The function that reads the file will return the list of players. The function that writes to the file will take a lineup list as the input parameter.. For part 2 replace the statement in the main method that declares the lineup list with a statement that calls the read method in the FilelO module. Call the Filelo module in any function that modifies the lineup list. Handle the exception that occurs if the program can't find the data file. Display a message and continue with the program so that a new file can be created. Do not close the program if no file is found. Use a top-down development process. For example, start by writing a main method that calls a function that prints the title. Test the program and fix any errors. Then add a function that prints the menu options, call the function from the main method, test it, and move on to the next feature. Get as much of the Part 1 functions completed before moving on to Part 2. Make sure that there is always a working version that can be turned in even if it is incomplete. Projects can require the use of material from any of the previous chapters covered in the textbook. Create a Team Management Python program that satisfies the specifications above. Put General Comments at the beginning of the project that includes (1) your name, (2) the project name, (3) the date, and (4) a description of the project. Turn in a ZIP file of the final version of the program. Include a Word document which contains output of the testing done on the program. The Word document must be inside the ZIP file. In the Comments section on the Assignment webpage, report (A) an estime of the time it took to complete the project. Report a single value in minutes, and (B) a single rating of the project, on an ordinal scale, as either (1) Easy, (2) Moderate, (3) Hard, OR (4) Challenging. SS 2B Trevor Garrett Tony Hunter lan Nolan Daniel David Phillip RF CF 3B 1B LF 588 299 535 580 443 588 430 374 102 173 74 176 182 113 185 129 113 12

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

Oracle RMAN For Absolute Beginners

Authors: Darl Kuhn

1st Edition

1484207637, 9781484207635

More Books

Students also viewed these Databases questions