Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ Player Derek Jeter Shortstop Right 190 88 New York Yankees HOF 14 72.4 Offense 3465 260 310 1923 1311 358 377 440 0.817 2006

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
c++
Player
Derek Jeter
Shortstop
Right
190
88
New York Yankees
HOF
14
72.4
Offense
3465
260
310
1923
1311
358
377
440
0.817
2006 2007 2008 2009 2012
Defense
3820
6605
254
976
2004 2005 2006 2009 2010
Player
Mike Trout
Centerfielder
Right
188
106
Los Angeles Angels
*
8
72.5
Offense
1324
285
305
903
752
200
419
581
1.000
2012 2013 2014 2015 2016 2018 2019
Defense
2768
38
20
993
*
Player
Miguel Carbera
First Baseman
Right
193
112
Detroit Tigers
*
11
69.6
Offense
2815
477
315
1429
1694
38
392
543
0.935
2005 2006 2010 2012 2013 2015 2016
69.6
Defense
10136
1858
152
987
*
Player
Ken Griffey Jr
Centerfielder
Left
190
88
Seattle Mariners
HOF
13
83.8
Offense
2781
630
284
1662
1836
184
370
538
0.907
1991 1993 1994 1996 1997 1998 1999
Defense
5607
154
89
985
1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
Player
Yadier Molina
Catcher
Right
180
92
St Louis Cardinals
*
9
40.2
Offense
1963
156
282
701
916
66
333
405
0.738
2013
Defense
13540
983
75
995
2008 2009 2010 2011 2012 2013 2014 2015 2018
Player
Buster Posey
Catcher
Right
185
95
San Francisco Giants
*
6
42.1
Offense
1963
156
282
701
916
66
333
405
0.738
2013
Defense
9035
623
50
995
2016
Player
Carlos Beltran
Centerfielder
185
97
Kansas City Royals
*
9
69.6
Offense
2725
435
279
1582
1587
312
350
486
0.837
2006 2007
Defense
5158
143
75
986
2006 2007 2008
Player
Larry Walker
RightFielder
Left
188
83
Montreal Expos
HOF
5
72.7
Offense
2160
383
313
1355
1311
230
400
565
965
1992 1997 1999
Defense
3976
213
57
987
1992 1993 1997 1998 1999 2001 2002
Player
Edgar Martinez
Designated Hitter
Right
183
79
Seattle Mariners
HOF
7
68.4
Offense
2247
309
312
1219
1261
49
418
515
0.933
1992 1995 1997 2001 2003
Defense
566
1025
81
952
*
Player
Barry Bonds
LeftFielder
Left
185
83
San Francisco Giants
*
14
162.8
Offense
2935
762
298
2227
1996
514
444
607
1.051
1990 1991 1992 1993 1994 1996 1997 2000 2001 2002 2003 2004
Defense
5637
173
97
984
1990 1991 1992 1993 1994 1996 1997 1998
Player
Hank Aaron
RightFielder
Right
183
81
Atlanta Braves
HOF
25
143.0
Offense
3771
755
305
2174
2297
240
374
555
0.928
*
Defense
7436
429
144
982
1958 1959 1960
rses/42891/assignments/426597 Duc Tuay Uy J7 PIT UIT ZOO JUUTTIKEITUS Available Feb 11 at 1pm - Mar 4 at 2:30pm 22 days , This is a Baseball Player Statistics program where you will be storing actual data of baseball players using structures and doing operations on them. The file baseballdata.txt has the data of 11 baseball players and multiple attributes related to their statistics. The schema of the data file is reflected in the file baseballdatadescription.txt : which describes what are the statistics in the data file of the player, and it holds the same for all the players. You will start by creating 3 different structures: a) offense: houses the offensive statistics of the players (Hits, HomeRuns, BattingAverage, Runs, RBI, stolen base, OBP, Slugging. OPS, Silver Slugger Years) b) defense: houses the defensive statistics of the players (Putouts. Assists, Errors, Fielding%. Golden Glove Years) c) player which nests the offense and defense structures and stores other extra metadata of the players(Name, Position, Bats, Height, Weight, Drafted By, HallofFame, AllStarGames) You need to parse the baseballdata.txt file and create an array of players with all of their statistics loaded from the incoming file. The statistics include various types of primitive data elements such as float, integer strings, booleans, and arrays. You should be able to determine the appropriate type for appropriate statistics by observing the file. Take the reference of baseballdatadescription.txt and make sure that your players have all of the statistics loaded. (50 pts) ing Str* + structure.com/courses/42891/assignments/426597 Lidyer. WHITTIL UTCOITETE N E SU UCLISSES ULICE metadata of the players(Name, Position, Bats, Height, Weight, Drafted By, Halloffame, AllStarGames) You need to parse the baseballdata.txt file and create an array of players; with all of their statistics loaded from the incoming file. The statistics include various types of primitive data elements such as float, integer, strings, booleans, and arrays. You should be able to determine the appropriate type for appropriate statistics by observing the file. Take the reference of baseballdatadescription.txt and make sure that your players have all of the statistics loaded. (50 pts) After you create the players array, write the following functions aprintOffensive offense) that prints only the offensive statistics of a single player that you pass to the function (10 pts) Sample Output: Offensive: 3465 Hits 260 HR-310 BA 1923 R 1311 RBI 358 SB 377 OBP 440 SLG 0.817 OPS 5 Silver Sluggers b)printDefensive(defense) that prints only the defensive statistics of a single player that you pass to the function(10 pts) Sample Output: Defensive: 3820 PO 6605 A 254 E 976% Fid 5 Golden Gloves cprintPlayer(player) that calls printOffensive and print Defensive functions, alongside extra player data to print the entire statistics of the player represented as a Player Card in the following 15.0 /42891/assignments/426597 After you create the players array, write the following functions a)printOffensiveoffense) that prints only the offensive statistics of a single player that you pass to the function (10 pts) Sample Output: Offensive: 3465 Hits 260 HR-310 BA 1923 R 1311 RBI 358 SB 377 OBP 440 SLG 0.817 OPS 5 Silver Sluggers b)printDefensive defense&) that prints only the defensive statistics of a single player that you pass to the function(10 pts) Sample Output: Defensive: 3820 PO 6605 A 254 E 976% Fld 5 Golden Gloves c)printPlayer (player) that calls printOffensive and printDefensive functions, alongside extra player data to print the entire statistics of the player, represented as a Player Card in the following form: (50 pts) An example player card looks like so :( You should call printDefensive and printOffensive functions defined above) hor s . All star se 102 Baseball Card Derek Jocet Now York Yankoo shotstop night on a WHIT2.4 1465 Hits 2 0 1211311355377 44017 2 05250 *6rid 5 Colden Gloves Yeugers For the subsequent operations, you will be printing a similar type of Player Card as a /42891/assignments/426597 Torm:(0 pts) An example player card looks like so: (You should call printDefensive and printOffensive functions defined above) 190cm 88kg WAR: 72.4 HOP* 5* All Star CSC 102 Baseball Card Derek Jeter New York Yankees Short Stop Right offensive: 3465 Hits 260 HR .310 BA 1923 R 1311 RBI 358 SB Defensive: 3820 PO 6605 A 254 E 9763 Fid 5 Golden Gloves Thank you for Buying 377 OBP 440 SIG 0.817 OP 5 Silver Sluggers For the subsequent operations, you will be printing a similar type of Player Card as a result of search/sort operations. d) create a function searchByName(string) that asks the user for the first name of the player and prints the Player Card (similar to the visual format of Section c) (30 pts) e) Print the Player Card of all the players who are in the Hall of Fame ("in the data file represents Not eligible for HOF, elsewise any other player is HOF) (20 pts) f) Export the player Card of the people whose WAR value is greater than 70 into the file war_70.txt (Similar to printing the player cards to the console, but this time you need to print them in the file) (30 pts) g) Export the player Card of the people who had more than 100 Stolen Bases into the file stolenbase_100.txt (Similar to printing the player cards to the console, but this time you need to print them in the file) (30 pts) Bonus: g) Sort the players by their WAR value and print the top 3 players by their WAR. (80 pts) h) Export the player Card of all the players who won the Silver Slugger and Golden Glove award in the same year(s) at least one (At least 1 common item in the Silver Slugger Years rses/42891/assignments/426597 Duc Tuay Uy J7 PIT UIT ZOO JUUTTIKEITUS Available Feb 11 at 1pm - Mar 4 at 2:30pm 22 days , This is a Baseball Player Statistics program where you will be storing actual data of baseball players using structures and doing operations on them. The file baseballdata.txt has the data of 11 baseball players and multiple attributes related to their statistics. The schema of the data file is reflected in the file baseballdatadescription.txt : which describes what are the statistics in the data file of the player, and it holds the same for all the players. You will start by creating 3 different structures: a) offense: houses the offensive statistics of the players (Hits, HomeRuns, BattingAverage, Runs, RBI, stolen base, OBP, Slugging. OPS, Silver Slugger Years) b) defense: houses the defensive statistics of the players (Putouts. Assists, Errors, Fielding%. Golden Glove Years) c) player which nests the offense and defense structures and stores other extra metadata of the players(Name, Position, Bats, Height, Weight, Drafted By, HallofFame, AllStarGames) You need to parse the baseballdata.txt file and create an array of players with all of their statistics loaded from the incoming file. The statistics include various types of primitive data elements such as float, integer strings, booleans, and arrays. You should be able to determine the appropriate type for appropriate statistics by observing the file. Take the reference of baseballdatadescription.txt and make sure that your players have all of the statistics loaded. (50 pts) ing Str* + structure.com/courses/42891/assignments/426597 Lidyer. WHITTIL UTCOITETE N E SU UCLISSES ULICE metadata of the players(Name, Position, Bats, Height, Weight, Drafted By, Halloffame, AllStarGames) You need to parse the baseballdata.txt file and create an array of players; with all of their statistics loaded from the incoming file. The statistics include various types of primitive data elements such as float, integer, strings, booleans, and arrays. You should be able to determine the appropriate type for appropriate statistics by observing the file. Take the reference of baseballdatadescription.txt and make sure that your players have all of the statistics loaded. (50 pts) After you create the players array, write the following functions aprintOffensive offense) that prints only the offensive statistics of a single player that you pass to the function (10 pts) Sample Output: Offensive: 3465 Hits 260 HR-310 BA 1923 R 1311 RBI 358 SB 377 OBP 440 SLG 0.817 OPS 5 Silver Sluggers b)printDefensive(defense) that prints only the defensive statistics of a single player that you pass to the function(10 pts) Sample Output: Defensive: 3820 PO 6605 A 254 E 976% Fid 5 Golden Gloves cprintPlayer(player) that calls printOffensive and print Defensive functions, alongside extra player data to print the entire statistics of the player represented as a Player Card in the following 15.0 /42891/assignments/426597 After you create the players array, write the following functions a)printOffensiveoffense) that prints only the offensive statistics of a single player that you pass to the function (10 pts) Sample Output: Offensive: 3465 Hits 260 HR-310 BA 1923 R 1311 RBI 358 SB 377 OBP 440 SLG 0.817 OPS 5 Silver Sluggers b)printDefensive defense&) that prints only the defensive statistics of a single player that you pass to the function(10 pts) Sample Output: Defensive: 3820 PO 6605 A 254 E 976% Fld 5 Golden Gloves c)printPlayer (player) that calls printOffensive and printDefensive functions, alongside extra player data to print the entire statistics of the player, represented as a Player Card in the following form: (50 pts) An example player card looks like so :( You should call printDefensive and printOffensive functions defined above) hor s . All star se 102 Baseball Card Derek Jocet Now York Yankoo shotstop night on a WHIT2.4 1465 Hits 2 0 1211311355377 44017 2 05250 *6rid 5 Colden Gloves Yeugers For the subsequent operations, you will be printing a similar type of Player Card as a /42891/assignments/426597 Torm:(0 pts) An example player card looks like so: (You should call printDefensive and printOffensive functions defined above) 190cm 88kg WAR: 72.4 HOP* 5* All Star CSC 102 Baseball Card Derek Jeter New York Yankees Short Stop Right offensive: 3465 Hits 260 HR .310 BA 1923 R 1311 RBI 358 SB Defensive: 3820 PO 6605 A 254 E 9763 Fid 5 Golden Gloves Thank you for Buying 377 OBP 440 SIG 0.817 OP 5 Silver Sluggers For the subsequent operations, you will be printing a similar type of Player Card as a result of search/sort operations. d) create a function searchByName(string) that asks the user for the first name of the player and prints the Player Card (similar to the visual format of Section c) (30 pts) e) Print the Player Card of all the players who are in the Hall of Fame ("in the data file represents Not eligible for HOF, elsewise any other player is HOF) (20 pts) f) Export the player Card of the people whose WAR value is greater than 70 into the file war_70.txt (Similar to printing the player cards to the console, but this time you need to print them in the file) (30 pts) g) Export the player Card of the people who had more than 100 Stolen Bases into the file stolenbase_100.txt (Similar to printing the player cards to the console, but this time you need to print them in the file) (30 pts) Bonus: g) Sort the players by their WAR value and print the top 3 players by their WAR. (80 pts) h) Export the player Card of all the players who won the Silver Slugger and Golden Glove award in the same year(s) at least one (At least 1 common item in the Silver Slugger Years

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases DeMYSTiFieD

Authors: Andy Oppel

2nd Edition

0071747990, 978-0071747998

More Books

Students also viewed these Databases questions

Question

Identify some of the global differences when negotiating.

Answered: 1 week ago

Question

Describe the team performance model.

Answered: 1 week ago