Question: Java We have declared a method called putCaption with one char[][] parameter art , two int parameters row and col , and a String parameter

Java We have declared a method called putCaption with one char[][] parameter art, two int parameters row and col, and a String parameter caption.

TASK: Fill in the body of the putCaption method such that it will overlay caption onto art such that the first character of caption is placed at art[row][col] and is surrounded by a frame of asterisks (*).

HINT: The top-left corner of art is the point (0,0), which is art[0][0].

HINT: The first dimension of art is the vertical dimension. For example, art[0] is the first row of art.

Sample Input:

Gollum 9 8 ***************************************** * .';:;'. * * /_' _' /\ __ * * ;a/ e= J/-'" '. * * \ ~_ ( -' ( ;_ ,. * * L~"'_. -. \ ./ ) * * ,'-' '-._ _; )' ( * * .' .' _.'") \ \( | * * / ( .-' __\{`', \ | * * / .' / _.-' " ; / | * * / / '-._'-, / / \ ( * * __/ (_ ,;' .-' / / /_'-._ * * `"-'` ~` ccc.' __.',' \j\L\ * * .='/|\7 * * ' ` * *****************************************

Sample Output:

***************************************** * .';:;'. * * /_' _' /\ __ * * ;a/ e= J/-'" '. * * \ ~_ ( -' ( ;_ ,. * * L~"'_. -. \ ./ ) * * ,'-' '-._ _; )' ( * * .' .' _.'") \ \( | * * ********-' __\{`', \ | * * *Gollum* _.-' " ; / | * * /********._'-, / / \ ( * * __/ (_ ,;' .-' / / /_'-._ * * `"-'` ~` ccc.' __.',' \j\L\ * * .='/|\7 * * ' ` * *****************************************

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!