WORLD SERIES (C++)   Code two functions to fill an array with the names of every World Series winning team from 1903 to 2020, then output each World Series winner and the number of times the team won the championship.  The input file is attached, along with a main function and screen print. Please note team names that include two words, such as Red Sox, have an underscore in place of the space. This enables you to use the extraction operator with a single string variable.    The following resources are included: Here is main.  #include #include #include using namespace std;

Database Systems: Design, Implementation, & Management
11th Edition
ISBN:9781285196145
Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Chapter7: Introduction To Structured Query Language (sql)
Section: Chapter Questions
Problem 11RQ
icon
Related questions
Question
WORLD SERIES (C++)
 
Code two functions to fill an array with the names of every World Series winning team from 1903 to 2020, then output each World Series winner and the number of times the team won the championship.  The input file is attached, along with a main function and screen print. Please note team names that include two words, such as Red Sox, have an underscore in place of the space. This enables you to use the extraction operator with a single string variable. 

 

The following resources are included:

Here is main. 

#include <iostream>
#include <fstream>
#include<string>

using namespace std;

// Add function declarations and documentation here

void fill(string teams[], int size);
void findWinner(string teams[], int size);


int main()
{

const int SIZE = 118;
int lastIndex;
string team[SIZE];

fill(team, SIZE);
findWinner(team, SIZE);

return 0;
}

// Add function definitions here

Enter team: Nationals
Nationals won the World Series in 2019
Run another search? (y/n): y
Enter team: Eagles
Eagles never won a World Series
Run another search? (y/n): y
Enter team: Giants
Giants won the World Series in 1905
Giants won the World Series in 1921
Giants won the World Series in 1922
Giants won the World Series in 1933
Giants won the World Series in 1954
Giants won the World Series in 2010
Giants won the World Series in 2012
Giants won the World Series in 2014
Run another search? (y/n): y
Enter team: Rangers
Rangers never won a World Series
Run another search? (y/n):
Transcribed Image Text:Enter team: Nationals Nationals won the World Series in 2019 Run another search? (y/n): y Enter team: Eagles Eagles never won a World Series Run another search? (y/n): y Enter team: Giants Giants won the World Series in 1905 Giants won the World Series in 1921 Giants won the World Series in 1922 Giants won the World Series in 1933 Giants won the World Series in 1954 Giants won the World Series in 2010 Giants won the World Series in 2012 Giants won the World Series in 2014 Run another search? (y/n): y Enter team: Rangers Rangers never won a World Series Run another search? (y/n):
110 GIANTS
80 CARDINALS
ca CARDINALS
89 TWINS
1 AMERICAS
2 NO_SERIES
45 YANKEES
2
46 INDIANS
90 BLUE JAYS
3 GIANTS
47 YANKEES
91 BLUE JAYS
4 WHITE_SOx
5 CUBS
6 CUBS
7 PIRATES
8 ATHLETCS
9 ATHLETICS
48 YANKEES
92 STRIKE_CANCELLED_SERIE
93 BRAVES
94 YANKEES
49 YANKEES
50 YANKEES
51 YANKEES
95 MARLINS
52 GAINTS
96 YANKEES
53 DODGERS
97 YANKEES
10 RED SOXX
54 YANKEES
98 YANKEES
11 ATHLETICS
55 BRAVES
99 DIAMONBACKS
12 BRAVES
56 YANKEES
100 ANGELS
13 RED SOX
57 DODGERS
101 MARLINS
102 RED SOXx
103 WHITE Sox
14 RED_SOX
58 PIRATES
15 WHITE_SOX
59 YANKEES
16 RED_SOX
60 YANKEES
104 CARDINALS
17 REDS
61 DODGERS
105 RED_SOX
18 INDIANS
62 CARDINALS
106 PHILLIES
19 GIANTS
63 DODGERS
107 YANKEES
20 GIANTS
64 ORIOLES
108 GIANTS
21 YANKEES
65 CARDINAKLS
109 CARDINALS
66 TIGERS
67. METS
22 SENATORS
110
23 PIRATES
111 RED_SOX
112 GIANTS
113 ROYALS
24 CARDINALS
68 ORIOLES
25 YANKEES
69 PIRATES
70 ATHLETICS
71 ATHLETICS
72 ATHLETICS
26 YANKEES
114 CUBS
27 ATHLETICS
115 ASTROS
28 ATHLETICS
116 RED SOXX
29 CARDINALS
73 REDS
117 NATIONALS
30 YANKEES
118 DODGERS
74 REDS
E VANKE
75 YANKEES
31 GIANTS
32 CARDINALS
76 YANKEES
33 TIGERS
77 PIRATES
19 DHILLIES
34 YANKEES
78 PHILLIES
10. DODGERS
35 YANKEES
36 YANKEES
37 YANKEES
80 CARDINALS
81 ORIOLES
82 TIGERS
83 ROYALS
38 REDS
39 YANKEES
40 CARDINALS
84 METS
41 YANKEES
85 TWINS
42 CARDINALS
86 DODGERS
43 TIGERS
87 ATHLETICS
44 CARDINALS
88 REDS
Cancel
Print
Transcribed Image Text:110 GIANTS 80 CARDINALS ca CARDINALS 89 TWINS 1 AMERICAS 2 NO_SERIES 45 YANKEES 2 46 INDIANS 90 BLUE JAYS 3 GIANTS 47 YANKEES 91 BLUE JAYS 4 WHITE_SOx 5 CUBS 6 CUBS 7 PIRATES 8 ATHLETCS 9 ATHLETICS 48 YANKEES 92 STRIKE_CANCELLED_SERIE 93 BRAVES 94 YANKEES 49 YANKEES 50 YANKEES 51 YANKEES 95 MARLINS 52 GAINTS 96 YANKEES 53 DODGERS 97 YANKEES 10 RED SOXX 54 YANKEES 98 YANKEES 11 ATHLETICS 55 BRAVES 99 DIAMONBACKS 12 BRAVES 56 YANKEES 100 ANGELS 13 RED SOX 57 DODGERS 101 MARLINS 102 RED SOXx 103 WHITE Sox 14 RED_SOX 58 PIRATES 15 WHITE_SOX 59 YANKEES 16 RED_SOX 60 YANKEES 104 CARDINALS 17 REDS 61 DODGERS 105 RED_SOX 18 INDIANS 62 CARDINALS 106 PHILLIES 19 GIANTS 63 DODGERS 107 YANKEES 20 GIANTS 64 ORIOLES 108 GIANTS 21 YANKEES 65 CARDINAKLS 109 CARDINALS 66 TIGERS 67. METS 22 SENATORS 110 23 PIRATES 111 RED_SOX 112 GIANTS 113 ROYALS 24 CARDINALS 68 ORIOLES 25 YANKEES 69 PIRATES 70 ATHLETICS 71 ATHLETICS 72 ATHLETICS 26 YANKEES 114 CUBS 27 ATHLETICS 115 ASTROS 28 ATHLETICS 116 RED SOXX 29 CARDINALS 73 REDS 117 NATIONALS 30 YANKEES 118 DODGERS 74 REDS E VANKE 75 YANKEES 31 GIANTS 32 CARDINALS 76 YANKEES 33 TIGERS 77 PIRATES 19 DHILLIES 34 YANKEES 78 PHILLIES 10. DODGERS 35 YANKEES 36 YANKEES 37 YANKEES 80 CARDINALS 81 ORIOLES 82 TIGERS 83 ROYALS 38 REDS 39 YANKEES 40 CARDINALS 84 METS 41 YANKEES 85 TWINS 42 CARDINALS 86 DODGERS 43 TIGERS 87 ATHLETICS 44 CARDINALS 88 REDS Cancel Print
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Array
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
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781285196145
Author:
Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:
Cengage Learning
Principles of Information Systems (MindTap Course…
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781285867168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage