Question: Please answer the question and be detailed 6. A Caesar cipher shifts the letters by a fixed number of places. For example, let the shift
Please answer the question and be detailed

6. A Caesar cipher shifts the letters by a fixed number of places. For example, let the shift be 3. Then a becomes d, b becomes e, c becomes f, and so on, and z becomes c. Note that last 3 letters rotate to the front. (a) Write a function that receives a char as a parameter, and uses a switch statement to shift the char. If the char is a lowercase letter, it is shifted. Otherwise, leave it unchanged You don't need to write the whole switch. It is sufficient to write the cases for a, b, c, d, and w, x, y, and z, and default. The return value of the function is either the shifted lowercase letter or an unchanged char. (b) Write a loop that uses the function you just wrote to shift every lowercase letter in a string. char msg[] - "my secret message"; /* write a loop to shift/encrypt msg[]*/ (c) What is the output from the following printf statement? char chl - 'x'; char ch2 ,-,; char func (char ch) 1 return (ch >- 'a' && ch
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
