Question
WorldSeriesWinners.txtThis text file contains a chronological list of the World Series' winning teams from 1903 through 2022. (The first line in the file is the
WorldSeriesWinners.txtThis text file contains a chronological list of the World Series' winning teams from 1903 through 2022. (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 2022. Note that the World Series was not played in 1904 or 1994.) Your program will prompt the user to identify the file containing the World Series winners, read the file, and store its contents in an array. Your program will then repeatedly prompt the user to enter the name of a Major-League baseball team. When the user enters "quit" for a team name, your program will terminate. Search through the array you created with the contents of the World Series winners file. Keep track of the number of times they won the World Series as well as the years in which they won. If the team entered by the user has never won the World Series, display a message to that effect. Hint: Read the contents of the WorldSeriesWinners.txt file into an array. When the user enters a valid team name, your program should step through the array counting the number of times the selected team name appears as well as recording the years in which they won the World Series.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started