Question: WRITE IN C CODE! File: caesar.h, caesar.c Write a function encode(char *plaintext, int key) that encodes the string plaintext using the Caesar cipher by shifting

WRITE IN C CODE!

File: caesar.h, caesar.c

  • Write a function encode(char *plaintext, int key) that encodes the string plaintext using the Caesar cipher by shifting characters by key positions. It must produce results that are in all uppercase.

  • Write a function decode(char *ciphertext, int key) that decodes the ciphertext string using the Caesar cipher by shifting the characters back by key positions. It must produce results that are in all uppercase.

  • You may assume that the input text only includes alphabets, but may include both uppercase and lowercase letters. Your functions should treat the lowercase letters as uppercase and encode/decode them into corresponding uppercase letters.

File: caesar_main.c

  • Write a main function that exercises these two functions with different parameters to demonstrate that your code works correctly. You should print the text before and after the encode/decode function calls.

File: Makefile

  • Write a basic "Makefile" that can compile your solution to an executable called "caesar" with the commands "make caesar" and "make." Recall that makefile rules must start with a tab.

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!