Computers and Technology, 14.02.2020 03:46 bcampos
You are to develop a program in the Go programming language to read Baseball Player objects from an input file into a list/collection. You are to store the players in a collection in such a way that when they are displayed to the screen, they are in sorted order by lastname (then firstname to break name ordering ties).
Each line of the data file will contain one player's name and stats.
firstname lastname plateappearances atbats singles doubles triples homeruns walks hitbypitch
You may assume there are no errors in the data.
Operations/Computations:
Compute batting average: this is the sum of the hits (singles, doubles, triples, home runs) divided by the number of at-bats.
Compute slugging percentage. The slugging percentage is a weighted average. It is computed by:
= +2∗o+3∗p+4∗hom
m o
Compute the on base percentage. OBP is the sum of all hits, walks and hit-by-pitch divided by the number of plate appearances.
Compute the team's overall batting average. Summary of Operation
Prompt the user for the input file name. DO NOT hardcode file names into your program.
Open input file
Read each player and add them to your List.
Keep track of the number of items in the list
Write a report summary line to the screen.
Write each item from the list formatted to the screen, along with any other output required by
the assignment
Sample Input File
Hank Aaron 13941 12364 2294 624 98 755 1402 32
Chipper Jones 10614 8984 1671 549 38 468 1512 18
Ty Cobb 13099 11434 3053 724 295 117 1249 94
Jonny Bench 8674 7658 1254 381 24 389 891 19
Tony Gwynn 10232 9288 2378 543 85 135 434 24
John Smoltz 1167 948 118 26 2 5 79 3
This is in GoLang
Answers: 1
Computers and Technology, 21.06.2019 19:20
Number of megabytes of ram in a computer. qualitative or quantitative? because
Answers: 3
Computers and Technology, 23.06.2019 03:50
Q-1 which of the following can exist as cloud-based it resources? a. physical serverb. virtual serverc. software programd. network device
Answers: 1
Computers and Technology, 23.06.2019 07:30
What part of the interface displays the external references contained in a selected cell? the status bar the review tab the scroll bar the formula bar
Answers: 1
Computers and Technology, 23.06.2019 15:00
To check whether your writing is clear , you can
Answers: 2
You are to develop a program in the Go programming language to read Baseball Player objects from an...
Social Studies, 25.07.2019 03:30
Business, 25.07.2019 03:30
Computers and Technology, 25.07.2019 03:30
Mathematics, 25.07.2019 03:30
Chemistry, 25.07.2019 03:30
Biology, 25.07.2019 03:30