Question: Your program will contain 3 three functions: main, Encrypt and Decrypt All user interactivity should be limited in main Your Encrypt and Decrypt functions will
- Your program will contain 3 three functions: main, Encrypt and Decrypt
- All user interactivity should be limited in main
- Your Encrypt and Decrypt functions will take two arguments - an input string and an integer value called secret code
- Also, the Encrypt and Decrypt functions will return a string value
- In you main, you will first ask the user for an integer value that will be used to encode or decode text
- Then ask the user for a multi-line input string - i.e. the input can be one or more lines but read in a single input statement - use the tab character as the input delimiter
- Pass the input string using pointers and secret code to the Encrypt function to encode the input string by
- 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
- There should be no array use in the encrypt function.
- Return the encrypted string to the main where you will then use it as input to the Decrypt function
- Pass the encrypted string by pointers and secret code to the Decrypt function to decode the string by
- 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
- There should be no array use in the decrypt function
- If decrypted correctly, it should change back to the original string input by the user
- Return the decrypted string to the main
- End the main by printing the original input string, the encrypted string and decrypted string
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
