Question: PLEASE ANSWER IN JAVA!!! PLEASE FOLLOW THE INSTRUCTION. THANK YOU For this assignment, you will code a simple encryption application. The application encrypts words by

 PLEASE ANSWER IN JAVA!!! PLEASE FOLLOW THE INSTRUCTION. THANK YOU Forthis assignment, you will code a simple encryption application. The application encrypts

PLEASE ANSWER IN JAVA!!!

PLEASE FOLLOW THE INSTRUCTION. THANK YOU

For this assignment, you will code a simple encryption application. The application encrypts words by mapping a list of the twenty-six alphabetic characters to a list of twenty-six corresponding symbols using the lists indices. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 6 9 ! @#$ & ????70 symbols list 4 0 1 2 3 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 abcd efghijklmnopqrstuvwxyz alphabets list A For example, the word Elvis, would encrypt as follows: E- E -> ^ |-> + V ->; i >) S -> ] So, Elvis would encrypt to: ^+;)] Your task: You will start with the following class definition: C# Java using System: using System.Collections.Generic; ; import java.util.Scanner; import java.util.ArrayList: class Encryption { List symbols = new List charO; List=char> alphabets = new List=charO; class Encryption { ArrayList'); { symbols.add(!); symbols.add( @'); symbols.add(); symbols.add($); symbols.add("); symbols.add(&); symbols.add("); ? symbols.add(O; : symbols.add()); symbols.add(_); symbols.add(-); symbols.add(+); sshole dar". symbols.add(='); symbols.add(?'); het son symbols.add(); sacs symbols.add( {": symbols.add()); an symbols.add(D): 0; symbols.add(1) symbols.add(/'); symbols.add(''); symbols.add(:'); symbols.add(:'); symbols.add(); symbols.add() symbols.add(>'); for(char letter='a';letterc="z";letter++) { alphabets.Add(letter); } for(char letter='a';letterc='z';letter++) { alphabets.add(letter); } } } } } This creates two lists (2 ArrayLists in Java, and 2 Lists in C#). The first list contains twenty-six symbols (i.e. --,@,#,$,%, etc.), one symbol in each cell. The second list contains the twenty-six lower case letters of the alphabet (a - Z), one letter in each cell. From there you'll create the following six (6) methods: 1) Add a method return_alphabet, which takes in an int (integer) and returns the alphabet stored at that position, i.e. 5 would retum f 2) Add a method return_alphabet_index, which takes in an alphabetic character (char) and returns the index (int) of the character in the alphabets list, i.e. a would return 0, b would return 1. 3) Add a method return_symbol, which takes in an int (integer) and returns the symbol stored at that position, i.e. 5 would return & 4) Add a method return_symbol_index, which takes in a symbol (char) and returns the index (int) of the symbol in the symbols list, i.e. I would return 0, @ would return 1 5) Add a method encrypt_message, which takes in a plain-text string and returns the encrypted version of that string, i.e. Dwags would retum $:!*] The method should convert the plain-text string to lowercase (hint: Java: .toLowerCase(), C#: ToLower() The method should process each character in the plain-text string individually, encrypting each character and building a new string of encrypted characters (hint: Java: to CharArray(), C#: ToCharArray(), return_alphabet_index(), return_symbolo) If an invalid alphabet character is found, the following string should be returned: "Error: Invalid Character" 6) Add a method decrypt_message, which takes in an encrypted string and returns the decrypted version of that string, i.e. $:!*] would return dwags The method should process each symbol in the encrypted string individually, decrypting each symbol and building a new string of decrypted characters (hint: Java: to CharArray(), C#: ToCharArray(), return_symbol_index(), return_alphabet() If an invalid symbol is found, the following string should Invalid Symbol" Driver Program: Create an object of the class Encryption. Prompt the user with the following menu: 1 Encrypt a message 2 Decrypt a message 3 Quit Enter Choice If the user enters 1, prompt the user to enter a message, pass the result to the encrypt_message method, and print the returned encrypted string. If the user enters 2, prompt the user to enter an encrypted message, pass the encrypted message to the decrypt_message method, and print the returned decrypted string. If the user enters 3, terminate the program. If the user enters any character other than a 1, 2 or 3, the following error message should display: Error: Please enter valid input, and the user should be allowed to reenter a valid choice. Sample Output: 1 Encrypt a message 2 Decrypt a message 3 Quit Enter Choice 1 Enter the plain text message: MayTheForceBeWith You Encrypted Msg: =!(^&, [#^@^:/ Decrypted Msg: maytheforcebewithyou 1 Encrypt a message 2 Decrypt a message 3 Quit

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 Databases Questions!