For this part, I want you to revisit your Caesar encryption code from assignment 3 and modify it
so it contains at least two .c files: a driver containing the main function and a support file
containing a function that runs your Caesar encryption code. These files will be linked by a
header file (.h file).
The main function shall prompt the user to enter a string to encrypt and an encryption key to
offset the string values. These values are then passed the caesarEncrypt function, which encrypts
the string and prints out the value, and returns the number of characters in the string as check for
the user. A suggested caesarEncrypt prototype is int caesarEncrypt(const char inputString[], int
key);
The file caesar.h contains the function prototype for your Caesar encryption function and any
other functions located in caesar.c. In caesar.c and main.c, link the file together with common
header #include “caesar.h”
This header file with give main.c the definitions of the prototypes in declared in caesar.c.
Your header will use macros to ensure that files are only included once.
Code:#include <stdio.h> #define MAX 80 #define UPPER_ENCRYPT ((ch - 'A') + offset) % 26 + 'A' #define LOWER_ENCRYPT ((ch - 'a') + offset) % 26 + 'a' int len, offset; char message[MAX], c; int main(void) { printf("Enter message to be encrypted: "); for (len = 0; (c = getchar()) != '\n'; len++) { message[len] = c; } printf("Enter shift amount (1-25): "); scanf("%d", &offset); printf("Encrypted message: "); for (int i = 0; i < len; i++) { char ch = message[i]; if (message[i] >= 'a' && message[i] <= 'z') { ch = LOWER_ENCRYPT; } else if (message[i] >= 'A' && message[i] <= 'Z') { ch = UPPER_ENCRYPT; } printf("%c", ch); } printf("\n"); return 0; }
Help me please.