C++ Programming 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 with the number of times the team won the championship as well as the years they won them.  The input file is attached, along with the main function and screenprint. 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; // 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 WorldSeriesChampions.txt Americans No_Series Giants White_Sox Cubs Cubs Pirates Athletics Athletics Red_Sox Athletics Braves Red_Sox Red_Sox White_Sox Red_Sox Reds Indians Giants Giants Yankees Senators Pirates Cardinals Yankees Yankees Athletics Athletics Cardinals Yankees Giants Cardinals Tigers Yankees Yankees Yankees Yankees Reds Yankees Cardinals Yankees Cardinals Tigers Cardinals Yankees Indians Yankees Yankees Yankees Yankees Yankees Giants Dodgers Yankees Braves Yankees Dodgers Pirates Yankees Yankees Dodgers Cardinals Dodgers Orioles Cardinals Tigers Mets Orioles Pirates Athletics Athletics Athletics Reds Reds Yankees Yankees Pirates Phillies Dodgers Cardinals Orioles Tigers Royals Mets Twins Dodgers Athletics Reds Twins Blue_Jays Blue_Jays Strike_cancelled_series Braves Yankees Marlins Yankees Yankees Yankees Diamondbacks Angels Marlins Red_Sox White_Sox Cardinals Red_Sox Phillies Yankees Giants Cardinals Giants Red_Sox Giants Royals Cubs Astros Red_Sox Nationals Dodge

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

C++ Programming

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 with the number of times the team won the championship as well as the years they won them.  The input file is attached, along with the main function and screenprint. 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

WorldSeriesChampions.txt

Americans
No_Series
Giants
White_Sox
Cubs
Cubs
Pirates
Athletics
Athletics
Red_Sox
Athletics
Braves
Red_Sox
Red_Sox
White_Sox
Red_Sox
Reds
Indians
Giants
Giants
Yankees
Senators
Pirates
Cardinals
Yankees
Yankees
Athletics
Athletics
Cardinals
Yankees
Giants
Cardinals
Tigers
Yankees
Yankees
Yankees
Yankees
Reds
Yankees
Cardinals
Yankees
Cardinals
Tigers
Cardinals
Yankees
Indians
Yankees
Yankees
Yankees
Yankees
Yankees
Giants
Dodgers
Yankees
Braves
Yankees
Dodgers
Pirates
Yankees
Yankees
Dodgers
Cardinals
Dodgers
Orioles
Cardinals
Tigers
Mets
Orioles
Pirates
Athletics
Athletics
Athletics
Reds
Reds
Yankees
Yankees
Pirates
Phillies
Dodgers
Cardinals
Orioles
Tigers
Royals
Mets
Twins
Dodgers
Athletics
Reds
Twins
Blue_Jays
Blue_Jays
Strike_cancelled_series
Braves
Yankees
Marlins
Yankees
Yankees
Yankees
Diamondbacks
Angels
Marlins
Red_Sox
White_Sox
Cardinals
Red_Sox
Phillies
Yankees
Giants
Cardinals
Giants
Red_Sox
Giants
Royals
Cubs
Astros
Red_Sox
Nationals
Dodgers

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):
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 5 images

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 System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education