• support@answerspoint.com

What is Encoder Assignment ?.

1597

Hi, I am having trouble doing this assignment I am not sure where to even begin, here is the breakdown:

Create a secret encoder and decoder program. The program should function as follows: Begin by presenting a menu of options to the user. The user should be able to elect to encode a message, decode a message or quit. Repeatedly prompt the user with these options and end the program when the user elects to quit. User Interface: Top Secret word Encrypt / Decrypt Enter an option: (1) to encrypt a word (2) to decrypt a word (0) to exit

Option: Input: The user should only enter lowercase letters without any spaces. If the user enters an invalid string (i.e. “bob123”), they should be notified that this is an invalid string and be re-prompted for a new string.

Hint: A method would be useful to handle this validation as you’ll need to do the same thing in the next step. Encryption Key: This key will also be a String of lowercase characters without any spaces. Make sure the encryption key is valid before continuing. The encryption key is used to encode/decode the word. It is used to create a “shift index” (i.e. every character is shifted X characters to the right). For example and encryption key of “ab” would shift the characters by 3 (a + b = 1 + 2 = 3) Here’s an example of how your shift index should work: // original alphabet a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z // Shift Index = 1 z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y // Shift Index = 2 y,z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x

Note: the encrypted string that you generate should only contain lower case letters. Present the encrypted version of the message to the user. Here’s a sample running of this part of the program: Top Secret word Encrypt / Decrypt

Enter an option: (1) to encrypt a word (2) to decrypt a word (0) to exit

Option: 1 Enter an unencrypted word: craig Enter an encryption key: abc

Encoded Word: wluca

Next, write the decryption portion of the program. In this part of the program you will prompt the user for an encrypted string and an encryption key. Use the algorithm you wrote for the encryption task above to decrypt the message back into its unencrypted form. Here’s a sample running of the program: Top Secret word Encrypt / Decrypt Enter an option: (1) to encrypt a word (2) to decrypt a word (0) to exit Option: 2 Enter an encrypted word: wluca Enter your decryption key: abc Decoded Word: craig

0Answer


Your Answer

    Facebook Share        
       
  • asked 3 years ago
  • viewed 1597 times
  • active 3 years ago

Best Rated Questions