Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Each time a pattern is created, you decide if the array needs to be cleared before building the pattern by calling the clear () method.

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Each time a pattern is created, you decide if the array needs to be cleared before building the pattern by calling the clear () method. Once each pattern is built, call the print () method (described below) to display it in the terminal window. This means that the print () method will be called a total of 7 times (ONLY FROM main ()). BlueJ hint: As you test your code, you may need to click Options-Unlimited Buffering in the BlueJ terminal window in order to see all results. getDimension () Takes no parameters and returns an integer representing the dimension (number of rows and columns) for the character array. It should declare a keyboard Scanner. The dimension the method returns must be an odd number between 5 and 11 , inclusive. Keep asking the user for this number as long as it does not fit these criteria. print (char [] []) Takes a 2-dimensional character array as a parameter, and returns nothing. Its job is to print the array contents (from the parameter) in a neat format. For example, if the array has dimensions 55, and has the asterisk symbol (*) in every position, this method would print: Note that the method's printing must contain the top and bottom bordering - symbols. The number of columns in the array will determine how many dashes to print. The method should print one space before each of the array's characters. clear (char [] []) Takes a 2-dimensional character array as a parameter, and returns nothing. Its job is to place the space character in each location in the array. Write 7 methods that manipulate the contents of the 2D array of characters sent in the parameter. All methods have the same parameter (char [] []) and have a void return type. As you write these methods, you can do some of them the "hard" way, and some the "easy" way. If an already-written method does part of what you need to do, go ahead and call it from your new method! You can call one method from another just as easily as calling a method from main (). Some method may need a nested loop. Some may need 2 single loops. Some may not need a loop at all! The description of each of these methods on the next page shows the method signature, and what should result for a 55 array on the left, and a 77 array on the right. Remember, the array may have between 5 and 11 for its dimensions. verticalinside (char[][]) verticalinside (char[][]) leftArrow (char[][]) leftArrow (char[][]) rightArrow (char[][]) rightArrow (char[][]) Running verticalinside () Running horizontalinside () Running innerBox() Running flag () Running leftArrow () Running rightArrow() Running diamond()

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions