Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA A completed program: AreaFillT.class is provided for your testing. To testing this program, enter coordinates in the argument list input area. For example, 2

JAVA

image text in transcribed

A completed program: AreaFillT.class is provided for your testing. To testing this program, enter coordinates in the argument list input area. For example, 2 3 means for the third row and fourth column. Then use one of the data file: area.txt, area2.txt, and area3.txt to test this program. For example: enter 2 3 *area2.txt in the Cmd argument list then run AreaFillT.class, you should get the following results: AreaFillT.class: Results ..........00 ...0....0000 ...000000000 0000.....000 ............ ..#########. ..#...#####. ......#####. ...00000.... after filling ..........** ...*....**** ...********* ****.....*** ............ ..#########. ..#...#####. ......#####. ...00000.... 

Given Files:

* area.txt:

15 32 xxxx............................ ...xx........................... ..xxxxxxxxxxxx.................. ..x.........xxxxxxx............. ..x...........0000xxxx.......... ..xxxxxxxxxxxx0..000............ ..xxxxxxxxx...0...00.....0000000 ..........xx.......0000000000000 .....xxxxxxxxx........0......... ....xx.................00000.... ....xx.....................00... .....xxxxxxxxxxxxxxxxxx....00... ......................xx...00... .......................xxxx00000 ............................0000

* area2.txt:

9 12 ..........00 ...0....0000 ...000000000 0000.....000 ............ ..#########. ..#...#####. ......#####. ...00000....

* area3.txt

4 3 +++ @+@ @+@ @@@

Several text files (area.txt, area2.txt, and area3.txt) contain two integers followed by rows and columns filled with different characters. Study the format of the text file area2.txt: 9 12 ..........00 .0....0000 000000000 0000.....000 . . = . = .. = - 00000 First, read and display the contents of this matrix to the screen. Second, prompt the user for (row.col) coordinates (what are passed to your program through command line argument list). Note the character that is stored in that position Replace that character with a '*'. Then recur up, down, left, and right, (but NOT diagonally) and replace similar characters with '*. Study these two examples: Filename: area2.txt Enter ROW COL: 1 3 . . Filename: area 2.txt Enter ROW COL: 1 2 **********00 *******0000 ***000000000 0...-:.000 + + * . + + * . + * . . . . . TE # #. # #. . HO # # . 00000 . ! . . Display this new matrix. Hints: Filling an area, which is similar to escaping a maze, is naturally recursive. What are the base cases? Several text files (area.txt, area2.txt, and area3.txt) contain two integers followed by rows and columns filled with different characters. Study the format of the text file area2.txt: 9 12 ..........00 .0....0000 000000000 0000.....000 . . = . = .. = - 00000 First, read and display the contents of this matrix to the screen. Second, prompt the user for (row.col) coordinates (what are passed to your program through command line argument list). Note the character that is stored in that position Replace that character with a '*'. Then recur up, down, left, and right, (but NOT diagonally) and replace similar characters with '*. Study these two examples: Filename: area2.txt Enter ROW COL: 1 3 . . Filename: area 2.txt Enter ROW COL: 1 2 **********00 *******0000 ***000000000 0...-:.000 + + * . + + * . + * . . . . . TE # #. # #. . HO # # . 00000 . ! . . Display this new matrix. Hints: Filling an area, which is similar to escaping a maze, is naturally recursive. What are the base cases

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

More Books

Students also viewed these Databases questions

Question

D. Discuss the value of identifying just a few takeaway messages.

Answered: 1 week ago