Question
I'm working on a python programming project, it's a caesar cipher with a different way of decoding then the standard caesar cipher. 1) The program
I'm working on a python programming project, it's a caesar cipher with a different way of decoding then the standard caesar cipher.
1) The program should prompt the user for one of three commands:
a)e to encode a string
b)d to decode a string
c)q to quit
Any other command should raise an error 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 (text).
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.
The section in bold is the part I am struggling with.
I know it wants the command to basically ask for the encoded string and then a key word from the string when its decoded ie. vjg ecv twpu (the cat runs, with a rotation of 2) and then you input a word like 'cat' and the program cycles through until it finds cat in said string and then prints the decoded string as well as what the rotation was when it found the decoded message.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started