subject

One method of encoding messages is known as the "expanding square code". this method encodes message by placing the character of the message in an odd order square matrix row by row, and then retrieving them in a clockwise expanding square spiral from the center of the matrix. if the message is not exactly the right length to fill the matrix, the rest of the matrix is filled with asterisk characters (*). for example, the two square matrices below show the order in which the characters are placed in the matrix, and the order in which they are retrieved. notice that the order of retrieval begins at the center, then proceed to the right, and then spirals clockwise order in order out 1 2 3 4 5 21 22 23 24 25 6 7 8 9 10 20 7 8 9 10 11 12 13 14 15 19 6 1 2 11 16 17 18 19 20 18 5 4 3 12 21 22 23 24 25 17 16 15 14 13 message in: "this is a test " message out: "stssees a a* " your program must be able to encode messages by this method. the input (from standard in) will consist of a string of text entered by the user, containing an unknown number of characters n (0 < n < = 1000). from the length of the message, you should determine the minimum odd order required for the matrix, and perform the specified operation. the output for you program will be the encoded message.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:00
How can a broadcast station be received through cable and satellite systems?
Answers: 1
question
Computers and Technology, 22.06.2019 11:00
The editing of digital photos us about the same level of difficulty as editing an analog photo
Answers: 2
question
Computers and Technology, 23.06.2019 16:10
What is the ooh? a. omaha occupation handbook b. online occupational c. occupations online d. occupational outlook handbook select the best answer from the choices provided
Answers: 3
question
Computers and Technology, 24.06.2019 07:30
Aproject involves many computing systems working together on disjointed task towards a single goal what form of computing would the project be using
Answers: 3
You know the right answer?
One method of encoding messages is known as the "expanding square code". this method encodes message...
Questions