subject

Your program will contain 3 functions - main, Encrypt and Decrypt. All user interactivity (i. e. cin / cout) should be limited to within main only.
Your Encrypt function will take two parameters - a char pointer to an input string and an integer value called secret code - and return a char pointer. Use the function prototype: char* Encrypt(char* input, int secret);
Similarly, your Decrypt function will take two parameters - a char pointer to an encrypted string and an integer value called secret code - and return a char pointer. Use the function prototype: char* Decrypt(char* encrypted, int secret);
In your main, your program will first ask the user for an integer value that will be used as the secret to encrypt or decrypt the text. Provide an clear prompt to get the value.
Pass the input string from main using pointers and secret code to the Encrypt function to encode the input string by
Declaring a new character array in your function where you will copy the contents of the input array either before or during the following actions.
Down shifting (i. e. moving in the increasing direction) each character in the ASCII character-set by the number of the secret code, followed by
Reversing the characters in the shifted string
Do not use either C-string or C++ string helper functions.
There should be no user interactivity in the function.
Return the pointer to the new character array to the main.
In the main, the pointer returned by the Encrypt function should be stored in an appropriate variable named encrypted and then passed as an argument to the Decrypt function.
Pass the encrypted string from main by pointers and secret code to the Decrypt function to decode the string by
Declaring a new character array in your function where you will copy the contents of the encrypted array either before or during the following actions.
Reversing the characters of the string
Up shifting (i. e. moving in the decreasing direction) each character of the reversed string by the number of the secret code
Do not use either C-string or C++ string functions.
There should be no user interactivity in the function.
If decrypted correctly, it should change back to the original string input by the user.
Return the pointer to the new character array to the main.
In the main, the pointer returned by the Decrypt function should be stored in an appropriate variable named decrypted.
End the main by printing the original input string, the encrypted string and decrypted string. All three should be printed only after both Encrypt and Decrypt are finished. See the sample output below on what to print.

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 18:30, bankzdown
The method of presentation refers to the planning process for the presentation. the information chosen for the presentation. how the presentation topic will be introduced. how the presentation will be delivered.
Answers: 1
image
Computers and Technology, 21.06.2019 23:30, jcollings44
You picked the corridor which led you here. if the guards find you, they're going to be really angry! what is the synonym of angry
Answers: 1
image
Computers and Technology, 22.06.2019 05:00, brylove603
Pls do you believe that the use of 3d animation has grown in feature films over the last few years? if so, do you think the trend will continue? what are the forces driving this trend?
Answers: 2
image
Computers and Technology, 23.06.2019 18:00, joybeth9591
What can a word user do with the customize ribbon dialog box? check all that apply. minimize the ribbon add a new tab to the ribbon remove a group from a tab add a group to a tab choose which styles appear choose which fonts appear choose tools to appear in a group
Answers: 1
You know the right answer?
Your program will contain 3 functions - main, Encrypt and Decrypt. All user interactivity (i. e. ci...

Questions in other subjects:

Konu
Arts, 16.10.2020 23:01