Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For this python project build a flowchart to make sense of the project Background A rotation cipher is one of the simplest, plain-text ciphers, known

image text in transcribedimage text in transcribedimage text in transcribed

For this python project build a flowchart to make sense of the project

Background A rotation cipher is one of the simplest, plain-text ciphers, known since at least the time of Julius Caesar. It takes in a plain-text string, and translates it into a new string based on a rotation of the alphabet being used. The basis is a rotation, a re-sequencing of an alphabet. Consider the following example. Consider the alphabet being a single string consisting of the lower case English letters as below (shown with each letter's associated index: p Cl 10 11 12 13 14 15 16 17 1 19 20 21122 23 24 Then a rotation of 3 means that the first three letters of the alphabet are moved to the end of the sequence, while the other letters move up, as shown below. Notice that the movement is done one letter at a time. 9 10 11 12 13 14 15 16 17 18 19 20 21 A cipher is created by using the rotated alphabet to replace each letter in the original string with its rotated equivalent letter. Using the example above, the word "this is translated as follows: .the t' is found at index 19 in the alphabet. The letter in the rotated alphabet is w'. .the 'h' is found at index 7, the rotated letter is 'k' the i' is found at index 8, the rotated letter is T the 's' is found at index 18, the rotated letter is v Thus the string 'this' becomes the string wklv using a rotation of 3 Project Description Specification 1) The program should prompt the user for one of three commands: a)'e' to encode a string b)'d' to decode a string cy'q' to quit Any other command should raise an eror and reprompt 2) If the command is encode, then the program prompts for a string to encode and a rotation integer in the range of 1-25. The program then returns the encoded string. a) Important, the program should not encode any letter that is not in the lower case alphabet. Those letters should simply be passed through to the encoded string 3) If the command is decode, then the program should prompt for a string to decode and a plain-text word that appears in the text (decoded string). The output should be the rotation needed to decode the string and the decoded string (lexl). a) If the program receives one word that belongs in the decoded string, then the program searches for a rotation that finds that word in the decoded string. That is the proper rotation. Finding that rotation is the goal of the program. b) If no rotation is found, then the program should indicate this fact. 4) If the command is quit, then the program ends and prints a nice exit message

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions