Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java We have declared a method called crop with one char[][] parameter art and four int parameters leftX, rightx, topy, and bottomY. TASK: Fill in

java

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

We have declared a method called crop with one char[][] parameter art and four int parameters leftX, rightx, topy, and bottomY. TASK: Fill in the body of the crop method such that it returns the result of cropping art in the rectangle bounded by the corners (leftx, topY), (leftx, bottomy), (rightx, topy), and (rightx, bottomY), inclusive, wrapped in 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. Gollum ASCII art originally created by Shanaka Dias Sample Input: 10 18 1 5 ***************************************** * * * * * T'' -- ;a/ e= J/-'" '. I ~ ' -' ' ;- ,. "'-. - 1. ) -' '-.- -; )' ( .' -.'") I ll | 1 I .-' --!{"', IL * * * * * IL * --Il- '"-' ~' * '-.-'-, !!! ;'.-' || /_'-.- ccc.' --.',' \j\L\ .='/|\7 * * * ***************************************** Sample Output: *********** *.';:;'. * */_' _' /\* *;a/ e= J/* *\ ~_ ( * L~"'_. *********** Write a program, test using stdin stdout Time limit: 8 seconds Memory limit: 256 MB 1 static char[][] crop(char[][] art, int leftx, int rightx, int topy, int bottomy) { 2 // YOUR CODE HERE NM N00 1 point ner submission We have declared a method called crop with one char[][] parameter art and four int parameters leftX, rightx, topy, and bottomY. TASK: Fill in the body of the crop method such that it returns the result of cropping art in the rectangle bounded by the corners (leftx, topY), (leftx, bottomy), (rightx, topy), and (rightx, bottomY), inclusive, wrapped in 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. Gollum ASCII art originally created by Shanaka Dias Sample Input: 10 18 1 5 ***************************************** * * * * * T'' -- ;a/ e= J/-'" '. I ~ ' -' ' ;- ,. "'-. - 1. ) -' '-.- -; )' ( .' -.'") I ll | 1 I .-' --!{"', IL * * * * * IL * --Il- '"-' ~' * '-.-'-, !!! ;'.-' || /_'-.- ccc.' --.',' \j\L\ .='/|\7 * * * ***************************************** Sample Output: *********** *.';:;'. * */_' _' /\* *;a/ e= J/* *\ ~_ ( * L~"'_. *********** Write a program, test using stdin stdout Time limit: 8 seconds Memory limit: 256 MB 1 static char[][] crop(char[][] art, int leftx, int rightx, int topy, int bottomy) { 2 // YOUR CODE HERE NM N00 1 point ner submission

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

DB2 Universal Database V7.1 Application Development Certification Guide

Authors: Steve Sanyal, David Martineau, Kevin Gashyna, Michael Kyprianou

1st Edition

0130913677, 978-0130913678

More Books

Students also viewed these Databases questions

Question

Choosing Your Topic Researching the Topic

Answered: 1 week ago

Question

The Power of Public Speaking Clarifying the

Answered: 1 week ago