Question: I am trying this question in JAVA 8 but the thing is when I run this code I am getting extra columns and 2 extra

I am trying this question in JAVA 8 but the thing is when I run this code I am getting extra columns and 2 extra "-" in the output.

I am trying this question in JAVA 8 but the thing is

when I run this code I am getting extra columns and 2

extra "-" in the output. You have an array of numbers and

you would like to print these numbers in a tabular format to

make them look more organized. Each cell of the table contains exactly

one number and is surrounded by exactly four edges: As you can

You have an array of numbers and you would like to print these numbers in a tabular format to make them look more organized. Each cell of the table contains exactly one number and is surrounded by exactly four edges: As you can see above, each corner of the cell is represented by a " t " sign, vertical edges by "-" signs and horizontal edges by "I " signs. The width of the cell adjusts to accommodate the number of digits of the number written within it. There can be many cells in a row. Adjacent cells share an edge: Note that each cell has the same width. The width of the cell adjusts to match the width of the longest number in the table. The numbers in cells are aligned to the right, with any unused area in each cell filled with spaces. The table can consist of many rows, and adjacent rows share an edge: Given A=[4,35,80,123,12345,44,8,5,24,3,22,35] and K=4, the table would appear as follows: The function shouldn't return any value. You can print a string to the output (without or with the end-of-line character) as follows: System, out.print( "sample string"); System,out,println("whole line"); Assume that: - N is an integer within the range [1,200] is - K is an integer within the range [1,1,000,000,000] - each element of array A is an integer within the range [0.1,000,000,000]. In your solution, focus on correctness. The performance of your solution will not be the focus of the assessment. WRONG ANSWER (got Example test: ([4,35,80,123,12345,44,8,5,24,3],4) WRONG ANSWER (got expected expected

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The issue youre facing might be related to the way lines and columns are printed in your code Lets r... View full answer

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!