Answered step by step
Verified Expert Solution
Link Copied!

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() { List teams = 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Solaris 11.2 System Administration (oracle Press)

Authors: Harry Foxwell

1st Edition

007184421X, 9780071844215

More Books

Students also viewed these Databases questions

Question

Do you currently have a team agreement?

Answered: 1 week ago

Question

c. How is trust demonstrated?

Answered: 1 week ago

Question

c. Will leaders rotate periodically?

Answered: 1 week ago