Ex 2 Exercise Objectives • Text file processing Problem Description Python A simple scheme to encrypt text is as follows: • You ask the user to enter a keyword and remove duplicate letters from it. •...

i need the answer quicklyEx 2<br>Exercise Objectives<br>• Text file processing<br>Problem Description<br>Python<br>A simple scheme to encrypt text is as follows:<br>• You ask the user to enter a keyword and remove duplicate letters from it.<br>• Fill the keyword and the remaining letters of the alphabet into a 5x5 square (Since there are<br>only 25 squares, Z will not be changed)<br>Filling the keyword and the remaining letters should be done in sequence column by<br>column. Example with the keyword 'slayer'<br>R.<br>M<br>B<br>U<br>A<br>V<br>Y<br>E<br>F<br>K<br>To encrypt a letter, you find the last element in the letter's row and the element with the<br>same column(position) of the letter in the last row. (in this order).<br>• If the letter is already in the last row or column, you simply use the same letter.<br>• Space and new line will not be changed (same as the Z letter)<br>• Separate each letter with underscore ()<br>• Your program needs to read a file called data.txt and encrypt the content with the scheme<br>above and the save the output in a file called data.enc.<br>Example:<br>Keyword = slayer<br>Text to encrypt = hello<br>output = UK_XE_UE_UE_VQ<br>t%3D<br>H - UK<br>E - XE<br>L- UE<br>L- UE<br>0- VQ<br>

Extracted text: Ex 2 Exercise Objectives • Text file processing Problem Description Python A simple scheme to encrypt text is as follows: • You ask the user to enter a keyword and remove duplicate letters from it. • Fill the keyword and the remaining letters of the alphabet into a 5x5 square (Since there are only 25 squares, Z will not be changed) Filling the keyword and the remaining letters should be done in sequence column by column. Example with the keyword 'slayer' R. M B U A V Y E F K To encrypt a letter, you find the last element in the letter's row and the element with the same column(position) of the letter in the last row. (in this order). • If the letter is already in the last row or column, you simply use the same letter. • Space and new line will not be changed (same as the Z letter) • Separate each letter with underscore () • Your program needs to read a file called data.txt and encrypt the content with the scheme above and the save the output in a file called data.enc. Example: Keyword = slayer Text to encrypt = hello output = UK_XE_UE_UE_VQ t%3D H - UK E - XE L- UE L- UE 0- VQ

Jun 02, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here