symbols. Adde: symbols. Add) symbols.Add); symbols. Add(S) symbols. Add% symbols. Add& 2) Add a method retum_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 retun_symbol, which takes in an int (integer) and returns the symbol stored at that position, i.e. 5 would return & 4) Add a method retum_symbol_index, which takes in a symbol (char) and returns the index (int) of the symbol in the symbols list, i.e. ! would retum 0, @ would symbols add() symbols.add(@): symbols.add() symbols add(S) symbols.add") symbols.add(&); symbols.add(") symbols add(): symbols.add) symbols.add symbols add symbols add) symbols.add symbols.add(); symbols add.) symbols.add() symbols.add) symbols.add(T) symbols.add() symbols add) symbols.add() symbols.add) symbols.add) symbols.add. symbols.add() symbols. Add) symbols. Add(O: symbols. Add()): symbols. Add return 1. symbols. Add-) symbols. Add) symbols. Add) symbols. Add(); symbols. Add.) symbols. Add) symbols. Add) symbols. Add(T) symbols. Add() symbols. Adde) symbols. Add) symbols. Add: symbols. Add symbols. Add. symbols. Add 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 return $:1"] - 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: toCharArray(), C#: ToCharArray(), return_alphabet_index(). return_symbol()) 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 retums the decrypted version of that string, i.e. $:1"] 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: toCharArray(), C#: ToCharArray(), return_symbol_index(), return_alphabet()

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Help me solve this in C#. Begin with this code bellow here:

 

using System;
using System.Collections.Generic;

class Encryption {

List<char> symbols = new List<char>();

List<char> alphabets = new List<char>();

public Encryption() {

Copy and past the whole code from first page.

}

CSE1322L Assignment 2 v5.1.pdf
Search
Page 2 of 6
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. ! would return 0, @ would
{
{
symbols.Add('!');
symbols.add('!');
symbols.Add('@');
symbols.add('@');
symbols.Add('#);
symbols.Add('$');
symbols.add(#');
symbols.add('$');
symbols.add(^);
symbols.Add(^);
symbols.Add('&');
symbols.add('&');
symbols.Add('*');
symbols.Add('(');
symbols.Add(')');
symbols.Add('_');
symbols.Add('-');
symbols.Add('+');
symbols.Add('=");
symbols.Add('?');
symbols.Add(',');
symbols.Add('{');
symbols.Add('}');
symbols.Add('[');
symbols.Add(']');
symbols.Add('/');
symbols.Add('');
symbols.Add(';');
symbols.Add(':');
symbols.Add('.');
symbols.Add('<');
symbols.add(*');
symbols.add('(');
symbols.add(')');
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 return $:!*]
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: toCharArray(), C#: ToCharArray(), return_alphabet_index(),
return_symbol()
If an invalid alphabet character is found, the following string should be
symbols.add('_');
symbols.add('-');
symbols.add('+');
symbols.add('=');
symbols.add(?');
symbols.add(',');
symbols.add(' {');
symbols.add('}');
symbols.add('[');
symbols.add(']');
symbols.add('/");
symbols.add('|');
symbols.add(';');
symbols.add(':');
symbols.add('.');
symbols.add('<');
symbols.add(>');
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: toCharArray(), C#: ToCharArray(), return_symbol_index(),
return_alphabet())
If an invalid symbol is found, the following string should be returned: "Error:
Invalid Symbol"
symbols.Add(>');
for(char letter='a';letter<='z';lettertt)
for(char letter='a';letter<='z';lettertt)
{
{
alphabets.Add(letter);
alphabets.add(letter);
}
}
Driver Program:
}
}
Create an object of the class Encryption.
Prompt the user with the following menu:
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 Encrypt a message
2 Decrypt a message
3 Quit
1) Add a method return_alphabet, which takes in an int (integer) and returns the
alphabet stored at that position, i.e. 5 would return f
Enter Choice
Transcribed Image Text:CSE1322L Assignment 2 v5.1.pdf Search Page 2 of 6 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. ! would return 0, @ would { { symbols.Add('!'); symbols.add('!'); symbols.Add('@'); symbols.add('@'); symbols.Add('#); symbols.Add('$'); symbols.add(#'); symbols.add('$'); symbols.add(^); symbols.Add(^); symbols.Add('&'); symbols.add('&'); symbols.Add('*'); symbols.Add('('); symbols.Add(')'); symbols.Add('_'); symbols.Add('-'); symbols.Add('+'); symbols.Add('="); symbols.Add('?'); symbols.Add(','); symbols.Add('{'); symbols.Add('}'); symbols.Add('['); symbols.Add(']'); symbols.Add('/'); symbols.Add(''); symbols.Add(';'); symbols.Add(':'); symbols.Add('.'); symbols.Add('<'); symbols.add(*'); symbols.add('('); symbols.add(')'); 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 return $:!*] 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: toCharArray(), C#: ToCharArray(), return_alphabet_index(), return_symbol() If an invalid alphabet character is found, the following string should be symbols.add('_'); symbols.add('-'); symbols.add('+'); symbols.add('='); symbols.add(?'); symbols.add(','); symbols.add(' {'); symbols.add('}'); symbols.add('['); symbols.add(']'); symbols.add('/"); symbols.add('|'); symbols.add(';'); symbols.add(':'); symbols.add('.'); symbols.add('<'); symbols.add(>'); 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: toCharArray(), C#: ToCharArray(), return_symbol_index(), return_alphabet()) If an invalid symbol is found, the following string should be returned: "Error: Invalid Symbol" symbols.Add(>'); for(char letter='a';letter<='z';lettertt) for(char letter='a';letter<='z';lettertt) { { alphabets.Add(letter); alphabets.add(letter); } } Driver Program: } } Create an object of the class Encryption. Prompt the user with the following menu: 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 Encrypt a message 2 Decrypt a message 3 Quit 1) Add a method return_alphabet, which takes in an int (integer) and returns the alphabet stored at that position, i.e. 5 would return f Enter Choice
CSE1322L Assignment 2 v5.1.pdf
Search
Page 4 of 6
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:
MayTheForceBeWithYou
Encrypted Msg: =!</(^&,[#^@^:)/(<,|
1 Encrypt a message
2 Decrypt a message
3 Quit
Enter Choice:
2
Enter the encrypted message:
=!</(^&,[#^@^:)/(<,|
Decrypted Msg: maytheforcebewithyou
1 Encrypt a message
2 Decrypt a message
3 Quit
Enter Choice:
3
Transcribed Image Text:CSE1322L Assignment 2 v5.1.pdf Search Page 4 of 6 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: MayTheForceBeWithYou Encrypted Msg: =!</(^&,[#^@^:)/(<,| 1 Encrypt a message 2 Decrypt a message 3 Quit Enter Choice: 2 Enter the encrypted message: =!</(^&,[#^@^:)/(<,| Decrypted Msg: maytheforcebewithyou 1 Encrypt a message 2 Decrypt a message 3 Quit Enter Choice: 3
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 5 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education