Computers and Technology

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.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 05:00, edjiejwi
Lisa has a section of her document that she would like to include in the index. which option should lisa choose? mark index mark entry insert endnote add text
Answers: 3
image
Computers and Technology, 22.06.2019 13:00, jairus34
We as humans write math expression in infix notation, e. g. 5 + 2 (the operators are written in-between the operands). in a computer’s language, however, it is preferred to have the operators on the right side of the operands, i. e. 5 2 +. for more complex expressions that include parenthesis and multiple operators, a compiler has to convert the expression into postfix first and then evaluate the resulting postfix. write a program that takes an “infix” expression as input, uses stacks to convert it into postfix expression, and finally evaluates it. it must support the following operations: + - / * ^ % (example infix expression: (7 - 3) / (2 + 2)postfix expression: 7 3 - 2 2 + /result: 1guidelines: 1. you will need to use stacks in three placesa. one for the parenthesis check [char stack]b. one during infix to postfix [char stack]c. one during evaluation [int stack]for a and b above, you can use same array and same push, pop method as both ofthem are char. but for evaluation you have int stack and you might consider to createanother push pop method to handle it. maybe push_int, pop_int, etc. or find otherstrategy to utilize existing push pop method2. you can create a function for obtaining operator priority. that function should take anoperator as input and return its priority as an integer. this function will you a lot andreduce repeated code3. during evaluation you will need to convert char into integer. example for single digit: char c = '5'; int x = c - '0';
Answers: 2
image
Computers and Technology, 22.06.2019 16:00, eden1017
Why should characters such as / \ " ' * ; - ? [ ] ( ) ~ ! $ { } < > # @ & | space, tab, and newline be avoided in file names?
Answers: 2
image
Computers and Technology, 23.06.2019 07:00, MissSmartyPants88
To produce a starlight effect in her photograph, lina should choose the filter for her camera.
Answers: 1
Do you know the correct answer?
Your program will contain 3 functions - main, Encrypt and Decrypt. All user interactivity (i. e. ci...

Questions in other subjects:

Konu
Mathematics, 06.10.2019 11:00