Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C++ linkedlist assignment. Assignment Description One simple form of encryption

ID: 3837299 • Letter: C

Question

C++ linkedlist assignment.

Assignment Description One simple form of encryption is to replace every alphabetin an English text by any other alphabet. For example, one encryption scheme can be to replace characters in a text file as follows (case ignored): a b-d, c e, d f........ xaz, y-a, z b. To break this encryption one can analyze a typical text of English writing and see, as to which letters occur at what frequency, and then analyze the encrypted text for the frequency of letters. By comparing the frequency of etters in encrypted and non-encrypted texts, can break the encryption code designed above. In this assignment your program would do the followings: 1. Read a given text file character by character. first time, then it is added in-order 2. If character is a letter and that letter is being read for the as a letter node. Design of letter the linked list sensitivity. meaning in alphabetical order to a Letter Frequency ignore case node is given shortly. Be sure to add letter as an uppercase letter only to just updates (increases) 3. However, if letter has already been read in previouslines then program its frequency in its node by one. an output file. 4. Finally program prints the Letter frequency linked list to console and The UML diagram below shows the design of LetterNode. Letter Node Struct Fields frequency: size t letter char Next: LetterNode" Methods LetterNode(char ch, size t frq, LetterNode" ptr) toString0 const string In LetterNode letter is the field that can contain letters A to Z, and frequency field would contain as to how many times the letter was present in the input text file. Next is the usual pointer field to next node in the linked list. Followings are not allowed in this program: e 2 of 6

Explanation / Answer

Program to generate ciphertext : static char Cipher(char ch, int key) { if (!isalpha(ch)) return ch; char offset = isupper(ch) ? 'A' : 'a'; return (char)((((ch + key) - offset) % 26) + offset); } static string Encipher(string input, int key) { string output = ""; for each (char ch in input) output += Cipher(ch, key); return output; } -------------------------------------------------------------------- Program to generate frequency count : #include #include #include #include using namespace std; int main(int argc, char * const argv[]) { typedef map DefFrequencyMap; char c; DefFrequencyMap FrequencyMap; cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote