Question: Create a class named FinalExerciseA which will contain: A public method named transformMatrix() that takes a two dimensional array of any size containing String (String[][])
Create a class named FinalExerciseA which will contain:
- A public method named transformMatrix() that takes a two dimensional array of any size containing String (String[][]) and returns the array by transforming it using the following rules:
- All elements in the upper half of the array (and the elements on the diagonal) should be uppercase
- All elements in the lower half of the array should be lowercase
- Numbers and other characters stay as they are.
Example of the above transformation (double quotes are omitted in the example):
String[][] matrix = {{a, v, c, B, C},
{B, x, A, D, F},
{2, b, d, 5, h},
{m, R, d, G, H},
{s, d, t, Y, J}};
String[][] result = transformMatrix(matrix);
The output 2-dimensional array result will be:
String[][] result= {{A, V, C, B, C},
{b, X, A, D, F},
{2, b, D, 5, H},
{m, r, d, G, H},
{ s, d, t, y, J}};
Please write the code i will paste it in intelijidea
x Question 16 Create a class named FinalExerciseA which will contain: 1. A public method named transformMatrix() that takes a two dimensional array of any size containing String (String[][]) and returns the array by transforming it using the following rules: . All elements in the upper half of the array (and the elements on the diagonal) should be uppercase All elements in the lower half of the array should be lowercase Numbers and other characters stay as they are. Example of the above transformation (double quotes are omitted in the example): String[][] matrix = {{a, V, C, B, C), {B, X, A, D, F}. {2, b, d, 5, h} {m, R, d, G, H}, {s, d, t, Y, J}}; String[][] result = transform Matrix(matrix); The output 2-dimensional array result will be: String[][] result= {{A, V, C, B, C), {b, X, A, D, F}, {2, b, D, 5, H}, {m, r, d, G, H}, {s, d, t. y. J}}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
