Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Im learning Java programming language. Here is input filename game.txt. As you can see, The first line in this input file consists of the number

Im learning Java programming language. Here is input filename game.txt. As you can see,

The first line in this input file consists of the number of countries or also known as team participating in both games.

The second line are the names of these countries.

Then from lines 3 to 8 is the game data for badminton sports and their results that have 3 sets of score.

whereas from line 9 to 14 the game data for soccer sports and also their results.

As you can see, this input file from line 3 and onwards have difference number of items in a line since they are not the same because it depends on the particular sport.

4

Malaysia;Japan;Belgium;USA

Malaysia;Japan;21-19;21-8;21-17

Malaysia;USA;10-21;21-19;21-11

Malaysia;Belgium;21-9;21-9;21-0

Japan;Belgium;21-10;21-5;19-21

Japan;USA;16-21;21-11;21-18

USA;Belgium;1-21;13-21;16-21

Malaysia;Japan;0-4

Malaysia;USA;1-1

Malaysia;Belgium;2-11

Japan;Belgium;2-3

Japan;USA;4-2

USA;Belgium;4-5

my question is how do write the code so that this data will be stored into two different output files name as badminton.txt and soccer.txt just like the example below?

Output filename: Soccer.txt

image text in transcribed

and same goes to output filename : Badminton.txt

1 Team 1 2 Malaysia 3 Malaysia 4 Malaysia 5 Japan 6 Japan 7 USA 8 Team 2 Japan USA Belgium Belgium USA Belgium Score 0-4 1-1 2-11 2-3 4-2 4-5

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_2

Step: 3

blur-text-image_3

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

Database Management An Organizational Perspective

Authors: Richard T. Watson

1st Edition

0471305340, 978-0471305347

More Books

Students also viewed these Databases questions

Question

2. What additional techniques might be used to assess talent?

Answered: 1 week ago

Question

KEY QUESTION Refer to columns 1 and 6 in the table for question

Answered: 1 week ago