Computers and Technology

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.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 00:30, Angellbatton6763
At an open or uncontrolled intersection, yield if a. your road is paved and the crossroad is not b. the cross road is paved and yours is not c. you have two or more passengers in your vehicle d. you did not yield in the last intersection
Answers: 1
image
Computers and Technology, 22.06.2019 21:00, depression4eternity
The average cost of one year at a private college in 2012-2013 is $43,289. the average grant aid received by a student at a private college in 2012-2013 is $15,680.   what is the average student contribution for one year at a private college in 2012-2013?
Answers: 3
image
Computers and Technology, 23.06.2019 18:40, brooklyn4932
How does is make you feel when you're kind to others? what are some opportunities in your life to be more kind to your friends and loved ones? imagine a world where kindness has be outlawed. how would people act differently? would your day-to-day life change significantly? why or why not?
Answers: 2
image
Computers and Technology, 24.06.2019 04:30, littledudefromacross
Write and test a python program to find and print the largest number in a set of real (floating point) numbers. the program should first read a single positive integer number from the user, which will be how many numbers to read and search through. after reading in all of the numbers, the largest of the numbers input (not considering the count input) should be printed.
Answers: 1
Do you know the correct answer?
One method of encoding messages is known as the "expanding square code". this method encodes message...

Questions in other subjects:

Konu
Mathematics, 21.04.2020 23:52