Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

For this problem, please provide complete files. (2 source files(.c) and 1 heade

ID: 3561819 • Letter: F

Question

For this problem, please provide complete files. (2 source files(.c) and 1 header file(.h), you can mark with comment like "the following code locate at source/header file")

Write a C program that encrypts and decrypts strings using the Caesar Shift Cipher. The shift value must be an integer, but may be positive or negative. If the shift value is 4, then an 'A' becomes a 'E'. If the shift value is -4, then a 'A' becomes a 'W'. Note, the plaintext messages are encrypted using alphabetic characters only. Also, all characters in the messages must first be converted to uppercase before encrypting or decrypting them. Develop your own program driver to illustrate that your program works. You may use any library functions you wish.

Explanation / Answer

#include #include #define MAXSIZE 1024 void encrypt(char*); void decrypt(char*); int menu(); int main(void) { char c, choice[2], s[MAXSIZE]; while(1) { menu(); gets(choice); if((choice[0]=='e')||(choice[0]=='E')) { puts("Input text to encrypt->"); gets(s); encrypt(s); } else if((choice[0]=='d')||(choice[0]=='D')) { puts("Input text to decrypt->"); gets(s); decrypt(s); } else break; } return 0; } void encrypt(char*str) { int n=0; char *p=str, q[MAXSIZE]; while(*p) { if(islower(*p)) { if((*p>='a')&&(*p='D')&&(*p
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote