Question: You will write a menu driven program to manipulate strings as explained in this write up . The program should store 1 0 messages for

You will write a menu driven program to manipulate strings as explained in this write up.
The program should store 10 messages for possible manipulation. These will each be initialized to the string: This is the original message. This is a project for a student.
Main function:
This is where you collect user inputs and make calls to the other methods as requested by the user. This should be written in X86_64 assembly.
When the program is launched, the menu must be displayed and the user can make selections. The program must continue to execute until the user chooses to exit by entering q or Q.
Below is the description of each menu choice:
s or S: Show the current 10 messages to the user. These messages should all initially be set to: This is the original message.
r or R: Ask the user for a location in the array and read a new message from the user. Validate the message to make sure that it starts with a capital letter and ends with either a period ('.'), question mark ('?') or exclamation point ('!'). If the input is invalid, reject it with an error message to the user. Otherwise, if valid, replace the message in the location in the array picked by the user.
c or C: If the user selects this choice, the program will take the next string in the array to be encrypted and shift every letter in the message by the indicated number of positions in the alphabet. When a letter gets shifted past the beginning or end of the alphabet, wrap around to the other end to continue. For example, a 6 would shift any 'e' characters to 'k'. The shift must be applied to all letters in the message. Do not change any non-alphabet characters in the message, and preserve all capitalization.
This will be the option that implements your project 3 but you might need to make some edits to your project 3 to make it fit in this program. Unlike project 3, this caesar shift does not have a character limit.
Note: This option encrypts the message in the next spot in the array starting with the first spot (index 0). Once all messages in the array have been encrypted, the program should reset to the beginning position and start encrypting from there.
f or F: This option should implement a decryption scheme known as frequency analysis on all the strings that have been encrypted so far starting at the first string. If no strings have been encrypted it should print out No strings have been encrypted yet. You can read more about frequency analysis at this link: Frequency Analysis Example
For this program, we will implement a very basic and not so accurate method of frequency analysis. Our method will involve analyzing a string and picking the 5 most common letters in that string. We will then compute how far each of these is from the letter e.
We will then produce 5 possible decryptions of the string by:
Decryption 1 will be from comparing how far the most popular letter is from the letter e
Decryption 2 will be from comparing how far the second most popular letter is from the letter e
Decryption 3 will be from comparing how far the third most popular letter is from the letter e
Decryption 4 will be from comparing how far the fourth most popular letter is from the letter e
Decryption 5 will be from comparing how far the fifth most popular letter is from the letter e
See the sample run for examples.
q or Q: If this one is selected, the program simply terminates without doing or displaying any further messages!
Note 1: At any point during the execution if a choice other than the ones described above is entered, the program must show the message Invalid option! Try again!, print the menu options and let the user make a choice again.
Note 2: See the sample run posted on blackboard for an example of this program.
Note 3: Make sure you follow the rules outlined in the Implementation Details & Hints section below.
Implementation Details & Hints: There are several key features of this program solution that are required and/or will make your development job much easier. Here is a list of requirements and implementation hints:
See FAQ section for typical questions and answers.
You must break this problem down into subroutines rather than writing everything in main. The required subroutines are;
a read message subroutine,
This should be written as a C function
This is called when the user wants to read in a new message
It should validate the users input using the criteria mentioned above
The string the user enters could be any size so you need to account for this. (Hint: dynamic memory allocation)
a caesar subroutine,
Should be written in x86-64 assembly la

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