Assignment 6 Wiki - AustinSoup/CS101L GitHub Wiki

Caesar Cipher

The Caesar Cipher is an encryption/decryption method that shifts the alphabet. For instance, if you have a cipher that shifts by 1, A would become B, B would become C, Z would wrap and become A. To decrypt that cipher you simply shift by -1. It is a very simple cipher that is easily broken. http://en.wikipedia.org/wiki/Caesar_cipher

We need you to write a utility that Encodes and Decodes a Cipher.

The Rules. • The main program loop should ask the user if they want to. o 1. Encode a string o 2. Decode a string o Q. Quit • If the user chooses anything other than 1, 2, or Q, they get an error and it tries again. • If they want to encrypt a word or sentence, ask for the phrase and then ask for the # to shift by, once you encrypt the string, output the result to the user. • If they want to decrypt a word or sentence, ask for the string and the # of to shift by. Then display the decrypted string to the user. • Go back to the main menu until they select quit.

Image 1 Image 2 For the program I did edits on the functions. First I started with the print statements for the Print_menu functions, then I coded the rest of the other def functions. When coding I had to make sure the look ran properly in the loop or they would not work. After I finished the code I tested to make sure everything ran properly.

Image 1 The screen shot shows the program asking if the user want to Encode, Decode, or Quitting. After the user choses option 1 to encode. It will ask for a brief text for the user to input, then it will ask if how much they want to shift the letters. After the user has input their choices it will show the encrypted text. After it shows you will it will ask again if you want to Encode, Decode, or quit. The screen shot shows the user picks option 2. It again will ask for a brief text for the user to input, then it will ask if how much they want to shift the letters. After the user has input their choices it will show the decrypted text. Then again it will ask again if you want to Encode, Decode, or quit. The screenshot shows the user will input Q and quit the program. Once the program quits the user program a text will show telling the user to "Have an ordinary day".