Write a program that uses a while loop to store goals and assists for Lightning players in a text file called player_data.txt. The program should prompt the user for player names, goals, and assists as shown below. Enter data for at least five players. You can make up the names and data. Each datum should be stored on its own line in the file.

A+ Guide To It Technical Support
10th Edition
ISBN:9780357108291
Author:ANDREWS, Jean.
Publisher:ANDREWS, Jean.
Chapter14: Troubleshooting Windows After Startup
Section: Chapter Questions
Problem 2TC
icon
Related questions
Question

Python Question #6
Two programs are required and pseudocode is needed for each step

program6_1.py
Write a program that uses a while loop to store goals and assists for Lightning players in a text file called player_data.txt. The program should prompt the user for player names, goals, and assists as shown below. Enter data for at least five players. You can make up the names and data. Each datum should be stored on its own line in the file.
Sample Output (see 6_1.png)

program6_2.py
This program reads the text file created in the program above and displays its data. Use f-strings to create a table of rows and columns with column headings as follows:

  • PLAYER COLUMN: 10 characters wide and left-aligned.
  • GOALS COLUMN: 6 characters wide and centered.
  • ASSISTS COLUMN: 8 characters wide and centered.
  • TOTAL COLUMN: 6 characters wide and centered.

After printing the stats for each player, the program should report the name of the top scorer and his total points (goals + assists).
Sample Output (see image 6_2.png)

Input player name or Enter to quit Stamkos
Enter goals scored by Stamkos 35
Enter assists scored by this player 38
Input player name or Enter to quit Maroon
Enter goals scored by Maroon 29
Enter assists scored by this player 33
Input player name or Enter to quit Point
Enter goals scored by Point 50
Enter assists scored by this player 55
Input player name or Enter to quit Kucherov
Enter goals scored by Kucherov 55
Enter assists scored by this player 65
Input player name or Enter to quit Killorn
Enter goals scored by Killorn 33
Enter assists scored by this player 40
Input player name or Enter to quit
Transcribed Image Text:Input player name or Enter to quit Stamkos Enter goals scored by Stamkos 35 Enter assists scored by this player 38 Input player name or Enter to quit Maroon Enter goals scored by Maroon 29 Enter assists scored by this player 33 Input player name or Enter to quit Point Enter goals scored by Point 50 Enter assists scored by this player 55 Input player name or Enter to quit Kucherov Enter goals scored by Kucherov 55 Enter assists scored by this player 65 Input player name or Enter to quit Killorn Enter goals scored by Killorn 33 Enter assists scored by this player 40 Input player name or Enter to quit
PLAYER
GOALS ASSISTS TOTAL
Stamkos
35
38
73
Maroon
29
33
62
Point
50
55
105
Kucherov
55
65
120
Killorn
33
40
73
Kucherov is top scorer with 120 points
Transcribed Image Text:PLAYER GOALS ASSISTS TOTAL Stamkos 35 38 73 Maroon 29 33 62 Point 50 55 105 Kucherov 55 65 120 Killorn 33 40 73 Kucherov is top scorer with 120 points
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 4 images

Blurred answer
Knowledge Booster
File Input and Output Operations
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
A+ Guide To It Technical Support
A+ Guide To It Technical Support
Computer Science
ISBN:
9780357108291
Author:
ANDREWS, Jean.
Publisher:
Cengage,
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Enhanced Discovering Computers 2017 (Shelly Cashm…
Enhanced Discovering Computers 2017 (Shelly Cashm…
Computer Science
ISBN:
9781305657458
Author:
Misty E. Vermaat, Susan L. Sebok, Steven M. Freund, Mark Frydenberg, Jennifer T. Campbell
Publisher:
Cengage Learning