Question: Please use Java Q3. Write a program to encrypt an English text using the following mechanism. First, remove all the spaces from the text, then
Q3. Write a program to encrypt an English text using the following mechanism. First, remove all the spaces from the text, then let L be the length of this text. Now, write the characters of the text into a grid of rows and columns with following constraints. where La] is floor function and-r) is ceil function Ensure that rows columns >-L and a grid with minimum area. If multiple grids satisfy the above conditions, choose the one with the minimum area, i.e.. The encrypted message is obtained by displaying the characters as per the columns and insert a space after each column. Sample input: Have a nice day Note:Here, L-12, V12 is between 3 and 4 Sample output: Hae and via ecy Encode the message using above scheme and print the encoded message
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
