Analyze the following problem: (Gaddis) Programming Challenger 16. World Series Champions p.453, Chapter 7 16. World Series Champions If you have downloaded this book’s source code from the companion Web site, you will find the following files in this chapter’s folder: • Teams.txt—This file contains a list of several Major League baseball teams in alphabetical Anaheim Angels Arizona Diamondbacks Atlanta Braves Baltimore Orioles Boston Americans Boston Braves Boston Red Sox Brooklyn Dodgers Chicago Cubs Chicago White Sox Cincinnati Reds Cleveland Indians Detroit Tigers Florida Marlins Houston Astros Kansas City Royals Los Angeles Dodgers Milwaukee Braves Minnesota Twins New York Giants New York Mets New York Yankees Oakland Athletics Philadelphia Athletics Philadelphia Phillies Pittsburgh Pirates San Francisco Giants St. Louis Cardinals Toronto Blue Jays Washington Nationals Washington Senators order. Each team listed in the file has won the World Series at least once. • WorldSeriesWinners.txt—This file contains a chronological list of the World Series’ winning teams from 1903 to 2012. (The first line in the file is the name of the team that won in 1903, and the last line is the name of the team that won in 2012. Note that the World Series was not played in 1904 or 1994.) Boston Americans New York Giants Chicago White Sox Chicago Cubs Chicago Cubs Pittsburgh Pirates Philadelphia Athletics Philadelphia Athletics Boston Red Sox Philadelphia Athletics Boston Braves Boston Red Sox Boston Red Sox Chicago White Sox Boston Red Sox Cincinnati Reds Cleveland Indians New York Giants New York Giants New York Yankees Washington Senators Pittsburgh Pirates St. Louis Cardinals New York Yankees New York Yankees Philadelphia Athletics Philadelphia Athletics St. Louis Cardinals New York Yankees New York Giants St. Louis Cardinals Detroit Tigers New York Yankees New York Yankees New York Yankees New York Yankees Cincinnati Reds New York Yankees St. Louis Cardinals New York Yankees St. Louis Cardinals Detroit Tigers St. Louis Cardinals New York Yankees Cleveland Indians New York Yankees New York Yankees New York Yankees New York Yankees New York Yankees New York Giants Brooklyn Dodgers Write a program that displays the contents of the Teams.txt file on the screen and prompts the user to enter the name of one of the teams. The program should then display the number of times that team has won the World Series in the time period from 1903 to 2012. TIP: Read the contents of the WorldSeriesWinners.txt file into an array or vector. When the user enters the name of a team, the program should step through the array or vector counting the number of times the selected team appears. . Use the function createArray in Module 3, Lesson 3, Subtheme 2.1 to store the data files. Display the number of World Series wins and the winning years from 1903 to 2012. Store the data in class named TeamWinner with two atributes teamName of MyString datatype winningYears of IntegerList datatype, defined in Module 5, Lesson 3. Add the stream operators to the class. Define the constructors, destructors, mutators, and accessor member functions. Overload the Binary Relational stream operators in your class. int searchList(const int list[], int numElems, int value) { int index = 0; // Used as a subscript to search array int position = −1; // To record position of search value bool found = false; // Flag to indicate if the value was found while (index < numElems && !found) { if (list[index] == value) // If the value is found { found = true; // Set the flag position = index; // Record the value's subscript } index++; // Go to the next element } return position; // Return the position, or −1 } (Gaddis Tony, 2012) Define an array of TeamWinner and modify searchList function ( Lineal Search Algorithm ) for search specific team name. Show the result to user. Display all the statistics for all teams. The solution must contain the following: Class Specification has been separated from implementation. Output Code. Tables descriptive for every Class. UML diagram of the Classes Composition. CRC card
Please keep input under 1000 characters