Question: Need help with this problem, professor attached some tips on program specifications at the end: Attached you will find a file named WorldSeriesWinners.txt. The file
Need help with this problem, professor attached some tips on program specifications at the end:
Attached you will find a file named WorldSeriesWinners.txt. The file contains a chronological list of the winning teams in the World Series from 1903 through 2009. (the first line in the file is the name of the team won in 1903, and the last line is the name of the team that won in 2009. Note that the World Series was not played in 1904 or 1994, so those years are skipped in the file.)
Write a program that lets the user enter the name of a team, and then displays the number of times that team has won the World Series in the time period from 1903 through 2009.
Tips: Read the contents of the file into an array ( you may need to scan the file twice. The first time is to count the lines, then close the file. The second time to read the contents. When the user enters the name of a team, the program should step through the array, counting the number of times the selected team appears (Using String equals() method)
Couldn't attach the file, but this is what's on the attachment: 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 New York Yankees Milwaukee Braves New York Yankees Los Angeles Dodgers Pittsburgh Pirates New York Yankees New York Yankees Los Angeles Dodgers St. Louis Cardinals Los Angeles Dodgers Baltimore Orioles St. Louis Cardinals Detroit Tigers New York Mets Baltimore Orioles Pittsburgh Pirates Oakland Athletics Oakland Athletics Oakland Athletics Cincinnati Reds Cincinnati Reds New York Yankees New York Yankees Pittsburgh Pirates Philadelphia Phillies Los Angeles Dodgers St. Louis Cardinals Baltimore Orioles Detroit Tigers Kansas City Royals New York Mets Minnesota Twins Los Angeles Dodgers Oakland Athletics Cincinnati Reds Minnesota Twins Toronto Blue Jays Toronto Blue Jays Atlanta Braves New York Yankees Florida Marlins New York Yankees New York Yankees New York Yankees Arizona Diamondbacks Anaheim Angels Florida Marlins Boston Red Sox Chicago White Sox St. Louis Cardinals Boston Red Sox Philadelphia Phillies
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
