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
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F0732c3f7-f926-489a-8a12-bd0b1e56879e%2Fdf428ec3-6b5c-416d-9827-c2d891100a72%2Fn3j25klv_processed.png&w=3840&q=75)
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
![](/static/compass_v2/shared-icons/check-mark.png)
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
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
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
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education