Question: The encoder program should take in a variable x as an input. It should then display that same message but with each letter in the

The encoder program should take in a variable x as an input. It should then display that same message but with each letter in the message replaced with the letter that is x number of places further back in the alphabet. (i.e., if x =3 then "d" becomes "a","c" becomes "z","b" becomes "y", etc.). The encoded message is output to the terminal.
Write a second program that can decipher a message. It takes two inputs. Variable "offset" determines the number of places ahead in the alphabet to replace (i.e.,"a" becomes "d") while the second input takes the secret message. Output should just be the deciphered message.
Take turns writing a secret message and sending it to your teammate to decode. If you are able to translate it back to the original message, your program is working correctly.
For example, one user will run:
python cipher.py
hello
3
A message will be output which is the string "ebiil".
To decipher, you would run:
python decipher.py
ebiil
3
and obtain "hello" as output.
in python

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!