Question
Section 3: Create an object-oriented program Convert the Baseball Team Manager program from procedural to object-oriented. This shouldn't change the functionality of the code much,
Section 3: Create an object-oriented program
Convert the Baseball Team Manager program from procedural to object-oriented. This shouldn't change the functionality of the code much, but it should make the code more modular and reusable and easier to maintain.
Console
Baseball Team Manager
CURRENT DATE:
CAME DATE:
2021-03-19
2021-3-21
DAYS UNTIL GAME: 2
MENU OPTIONS
1.Display lineup
2.Add player
3.Remove player
4.Move playerj
5.Edit player position
6.Exit player stats
7.Exit program
POSITIONS
C, 1B,2B, 3B, SS, LF, CF, RF,P
Menu option: 1
Player:
1.Tommy La Stella
2.Mike Yastrzemski
3.Donovan Solano
4.Buster Posey
5.Brandon Belt
6.Brandon Crawford
7.ALeX Dickerson
8.Austin Slater
9.Kevin Gausman
POS:
3B
RF
2B
C
1B
SS
LF
CF
P
AB:
1316
563
1473
4575
3811
4402
586
569
56
H:
360
168
407
1380
1003
1099
160
147
2
AVG:
0.274
0.298
0.276
0.302
0.263
0.250
0.273
0.258
0.036
Menu option: 2
First name: Mike
Last name: Murach
Position: C
At bats: 0
Hits: 0
Mike Murach was added.
Menu option: 7
Bye!
Section 3: Create an object-oriented program (continued)
Specifications
Use a Player class that provide attributes that store the first name, last name, position, at bats, and hits for a player. This class should also provide methods or properties that return the player's full name and batting average.
Use a Lineup class to store the starting lineup for the team. This class should include methods that allow you to add, remove, move, retrieve, and edit a player. In addition, it should include a method or property that returns the number of players in the lineup, and an iterator so you can casily loop through cach player in the lineup.
- Use a file named ui to store the code for the user interface.
- Use a file named objects to store the code for the Player and Lineup classes.
Use a file named db to store the functions that work with the file that stores the data.
ReplyForward |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started