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

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 2PE
icon
Related questions
Question

Needs to use python and methods 

2:12
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
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: 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
Baseball Team Manager
2
3
4
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
с
20094
AB
10
11
H
HWAN
1
AVG
bridges.rwu.edu
0.2
0.364
0.333
0.25
Specifications
Use a list of lists to store each player in the lineup.
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
Transcribed Image Text:2:12 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 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: 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 Baseball Team Manager 2 3 4 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 с 20094 AB 10 11 H HWAN 1 AVG bridges.rwu.edu 0.2 0.364 0.333 0.25 Specifications Use a list of lists to store each player in the lineup. 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
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 3 images

Blurred answer
Knowledge Booster
Graphical User Interface
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT