Select Page

CS1 050 UMC Implement a Program that Prints a Particular String Discussion

Question Description

Description

For the lab assignment, you will implement a program that prints a particular string, encrypts this string and prints the encrypted version, and finally decrypts the encrypted string and prints this decrypted string (which should be the same as the original string).

To get started on this lab, type the following while logged in to tc.rnet.missouri.edu:

cs1050start lab10

This command will create a directory called lab10.Go into that directory (“cd lab10”) and get a list of the files there (“ls -la”).Notice that there is a file called lab10.c.You can start editing this file to do your lab.

To encrypt a string, you will change each printable character that is not a whitespace character.You will change those characters by replacing them with characters that come 2 letters later in the alphabet.For example, you would replace ‘B’ with ‘D’.To decrypt a string, you must do the opposite (i.e., again only replace printable non-whitespace characters but this time move backward in the alphabet – so, you would replace ‘D’ with ‘B’ for example).

Functions You Must Write

You may write any functions you wish to implement this program, in addition to the following functions.However, you must implement the following functions, and they must be prototyped as shown:

  • void Encrypt(char * s, int displacement) – This function takes a string and encrypts it in place by by shifting each character in the string that is printable but is not whitespace by displacement.For example, if displacement is 5, then the character ‘A’ would be changed to ‘F’ but a space would be left as a space.

"Place your order now for a similar assignment and have exceptional work written by our team of experts, guaranteeing you "A" results."

Order Solution Now