Question: Convert the program from procedural to object - oriented. This shouldn't change the functionality of the code mu put it should make the code more
Convert the program from procedural to objectoriented. This shouldn't change the functionality of the code mu put it should make the code more modular and reusable and easier to maintain.
Baseball Team Manager
CURRENT DATE:
GAME DATE:
DAYS UNTIL GAME:
MENU OPTIONS
Display lineup
Add player
Remove player
Move player
Edit player position
Edit player stats
Exit program
POSITIONS
C
Menu option:
Specifications:
Use a Player class that provides attributes that store the first name, last name, position, at bats, and hits for a player. This cla should also provide methods or properties that return the player's full name and batting average.
There should be files: baseballteam.py
dbpy File IO code
objects.py Define Player class and players.csv To house player name, position, atbats, hits
Functions in the baseballteam code should include: addplayerplayers getplayerposition getatbats gethitsatba getlineupnumberplayers prompt deleteplayerplayers moveplayerplayers editplayerpositionplayers editplayerstatsplayers displaylineupplayers getbattingavgatbats, hits displayseparator displaytitle displaydates displaymenu displaypositions main
Functions in
dbpy code should include: readplayers writeplayersplayers
Code in
objects.py file should include: class Player, main Player class should include properties; firstName, lastName, position, atBats, and hits & methods: def fullNameself def battingAvgself Alter your code in baseballteam.py to instantiate the Player class and use its properties and methods.
The program should round the batting averages to a maximum of three decimal places.
All menu options should work. Partial points will be given for each option that is operational.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
