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 object-oriented. 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: 2023-09-21
GAME DATE: 2023-09-22
DAYS UNTIL GAME: 1
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,LF,CF,RF,P
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 4 files: baseball_team.py,
db.py (File I/O code),
objects.py (Define Player class) and players.csv (To house player name, position, at_bats, hits).
Functions in the baseball_team code should include: add_player(players), get_player_position0, get_at_bats0, get_hits(at_ba get_lineup_number(players, prompt), delete_player(players), move_player(players), edit_player_position(players), edit_player_stats(players), display_lineup(players), get_batting_avg(at_bats, hits), display_separator0, display_title(0, display_dates 0, display_menu0, display_positions 0, main0
Functions in
db.py code should include: read_players(0, write_players(players).
Code in
objects.py file should include: class Player, main0. Player class should include 5 properties; firstName, lastName, position, atBats, and hits & 2 methods: def fullName(self), def battingAvg(self). Alter your code in baseball_team.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.
Convert the program from procedural to object -

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!