subject
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

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:30
Exchanging which type of data uses the least bandwidth? music photographs video voice bandwidth- the amount of data that can be moved between two points in a set time period
Answers: 1
question
Computers and Technology, 23.06.2019 00:30
Knowing that the central portion of link bd has a uniform cross sectional area of 800 mm2 , determine the magnitude of the load p for which the normal stress in link bd is 50 mpa. (hint: link bd is a two-force member.) ans: p = 62.7 kn
Answers: 2
question
Computers and Technology, 23.06.2019 12:00
If you embed a word table into powerpoint, what happens when you make edits to the embedded data? a. edits made to embedded data change the data in the source file; however, edits made to the source file will not be reflected in the embedded data. b. edits made to embedded data will change the data in the source file, and edits made to the source file will be reflected in the embedded data. c. edits made to embedded data don't change the data in the source file, nor will edits made to the source file be reflected in the embedded data. d. edits made to embedded data don't change the data in the source file; however, edits made to the source file will be reflected in the embedded data.
Answers: 1
question
Computers and Technology, 23.06.2019 12:10
2. fabulously fit offers memberships for$35 per month plus a $50 enrollmentfee. the fitness studio offersmemberships for $40 per month plus a$35 enrollment fee. in how many monthswill the fitness clubs cost the same? what will the cost be?
Answers: 1
You know the right answer?
You are to develop a program in the Go programming language to read Baseball Player objects from an...
Questions
question
Mathematics, 29.08.2019 18:00
Questions on the website: 13722362