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

  1. Your program will contain 3 three functions: main, Encrypt and Decrypt
  2. All user interactivity should be limited in main
  3. Your Encrypt and Decrypt functions will take two arguments - an input string and an integer value called secret code
  4. Also, the Encrypt and Decrypt functions will return a string value
  5. In you main, you will first ask the user for an integer value that will be used to encode or decode text
  6. 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
  7. Pass the input string using pointers and secret code to the Encrypt function to encode the input string by
    1. 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
    2. Reversing the characters in the shifted string
    3. There should be no array use in the encrypt function.
  8. Return the encrypted string to the main where you will then use it as input to the Decrypt function
  9. Pass the encrypted string by pointers and secret code to the Decrypt function to decode the string by
    1. Reversing the characters of the string
    2. Up shifting (i.e. moving in the decreasing direction) each character of the reversed string by the number of the secret code
    3. There should be no array use in the decrypt function
    4. If decrypted correctly, it should change back to the original string input by the user
  10. Return the decrypted string to the main
  11. 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 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 Databases Questions!