Question: Write a java program that prompts the user for the length of a multi-dimensional string array (both rows and columns) and reads values into the

Write a java program that prompts the user for the length of a multi-dimensional string array (both rows and columns) and reads values into the string array from the keyboard.

a) Display the length of the values (string length)

b) Change the length into a binary number using the modulo operator

c) Change the length into boolean values and pass through not gate

d) Transpose the rows and columns of the array and print as shown in the sample run

sample run

Enter the length of the row: 3

Enter the length of the column: 3

------Enter the string array element----------

Enter elements at row 0 column 0 : Audi

Enter elements at row 0 column 1 : Jeep

Enter elements at row 0 column 2 : mistubishi

Enter elements at row 1 column 0 : Ford

Enter elements at row 1 column 1 : Royce

Enter elements at row 1 column 2 : chev

Enter elements at row 2 column 0 : acura

Enter elements at row 2 column 1 : Toyota

Enter elements at row 2 column 2 : Nissan

-----Array display-------

Audi Jeep mistsubish

Ford Royce Chev

Acura Toyota Nissan

-----Array display-------

6 6 5

4 4 5

4 6 6

-----Changing the length into binary-------

0 0 1

0 0 1

0 0 0

-----Result after changing to Boolean------------

False False True

True True False

True True True

-----Result of reverse array-------

Audi Ford Acura

Jeep Royce Toyota

Mistsubish Chev Nissan

Run

Enter the length of the row: 3

Enter the length of the column: 2

Row length and column should be equal

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!