C++ Code two functions to fill an array with the names of every World Series winning team from 1903 to 2020. The input file is attached, along with a main function and screen print. Please note that 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
Here is your input file. It contains the list of all World Series winners by year in ascending order. The first World Series was played in 1903.
Here is your input file. It contains the list of all World Series winners by year in ascending order. The first World Series was played in 1903.
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
PLEASE NO REPOST
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images