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 USA;Belgium;4-5 Japan;USA;4-2 Malaysia;Japan;21-19;21-8;21-17 Malaysia;Japan;0-4 USA;Belgium;1-21;13-21;16-21 Malaysia;Belgium;21-9;21-9;21-0 Japan;USA;16-21;21-11;21-18 Malaysia;USA;1-1 Japan;Belgium;2-3 Japan;Belgium;21-10;21-5;19-21 Malaysia;USA;10-21;21-19;21-11 Malaysia;Belgium;2-11

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 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

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

Principles Of Multimedia Database Systems

Authors: V.S. Subrahmanian

1st Edition

1558604669, 978-1558604667

More Books

Students also viewed these Databases questions

Question

=+What is the nature of the unions in the particular country?

Answered: 1 week ago