Chapter 6: Use a list to store the players Update the program so it allows you to store the players for the starting lineup. This should include the player's name, position, at bats, and hits. In addition, the program should calculate the player's batting average from at bats and hits. Console ======= MENU OPTIONS 1 Display lineup Add player 2 3 Remove player 4 Move player 5 Edit player position Edit player stats Exit program 6 7 POSITIONS C, 1B, 2B, 3B, SS, LF, CF, RF, P ===== Menu option: 2 Name: Mike Position: OF Invalid position. Try again. POSITIONS C, 1B, 2B, 3B, SS, LF, CF, RF, P Position: CF At bats: 4 Hits: 1 Mike was added. Menu option: 1 Player 1 2 3 4 Baseball Team Manager Joe Tom Ben Mike Hits: 3 Mike was updated. Menu option: 6 Lineup number: 4 You selected Mike AB=0 H=0 At bats: 10 Menu option: 4 Current lineup number: 4 Mike was selected. New lineup number: 1 Mike was moved. Menu option: 7 Bye! POS P SS 3B с AB 10 11 9 4 H 2 HWAN 4 3 1 Specifications Use a list of lists to store each player in the lineup. AVG 0.2 0.364 0.333 0.25 ======== • Use a tuple to store all valid positions (C, 1B, 2B, etc). Make sure that the user's entry for position is valid, and entries for hits and at bats make sense. 7
Chapter 6: Use a list to store the players Update the program so it allows you to store the players for the starting lineup. This should include the player's name, position, at bats, and hits. In addition, the program should calculate the player's batting average from at bats and hits. Console ======= MENU OPTIONS 1 Display lineup Add player 2 3 Remove player 4 Move player 5 Edit player position Edit player stats Exit program 6 7 POSITIONS C, 1B, 2B, 3B, SS, LF, CF, RF, P ===== Menu option: 2 Name: Mike Position: OF Invalid position. Try again. POSITIONS C, 1B, 2B, 3B, SS, LF, CF, RF, P Position: CF At bats: 4 Hits: 1 Mike was added. Menu option: 1 Player 1 2 3 4 Baseball Team Manager Joe Tom Ben Mike Hits: 3 Mike was updated. Menu option: 6 Lineup number: 4 You selected Mike AB=0 H=0 At bats: 10 Menu option: 4 Current lineup number: 4 Mike was selected. New lineup number: 1 Mike was moved. Menu option: 7 Bye! POS P SS 3B с AB 10 11 9 4 H 2 HWAN 4 3 1 Specifications Use a list of lists to store each player in the lineup. AVG 0.2 0.364 0.333 0.25 ======== • Use a tuple to store all valid positions (C, 1B, 2B, etc). Make sure that the user's entry for position is valid, and entries for hits and at bats make sense. 7
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 2PE
Related questions
Question
Needs to use python and methods
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 3 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT