Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Modify the method so that instead of manually making teams, it reads it from a text file called TeamsList.txt. public void make_test_teams() { List teams
Modify the method so that instead of manually making teams, it reads it from a text file called TeamsList.txt.
public void make_test_teams() { Listteams = new ArrayList (); Player burns = new Player("George Burns", "George"); Player allen = new Player("Gracie Allen", "Gracie"); List ba = new ArrayList (); ba.add(burns); ba.add(allen); Team burns_and_allen = new Team("Burns and Allen", ba); teams.add(burns_and_allen); Player abbott = new Player("William Abbott", "Bud"); Player costello = new Player("Louis Cristillo", "Lou"); List ac = new ArrayList (); ac.add(abbott); ac.add(costello); Team abbott_and_costello = new Team("Abbott and Costello", ac); teams.add(abbott_and_costello); Player chico = new Player("Leonard Marx", "Chico"); Player groucho = new Player("Julius Marx", "Groucho"); Player harpo = new Player("Adolph Marx", "Harpo"); List mb = new ArrayList (); mb.add(chico); mb.add(groucho); mb.add(harpo); Team marx_brothers = new Team("Marx Brothers", mb); teams.add(marx_brothers); store_teams(teams); }
text file looks like this
team: "Burns and Allen" player: fullname: George Burns, nickname: George player: fullname: Gracie Allen, nickname: Gracie
team: "Abbott and Costello" player: fullname: William Abbott, nickname: Bud player: fullname: Louis Cristillo, nickname: Lou
team: "Marx Brothers" player: fullname: Leonard Marx, nickname: Chico player: fullname: Julius Marx, nickname: Groucho player: fullname: Adolph Marx, nickname: Harpo
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