Question: Part II - Strings For this problem, you will create a program called coder.c. This program should encode and decode strings following these simple rules

 Part II - Strings For this problem, you will create a
program called coder.c. This program should encode and decode strings following these

Part II - Strings For this problem, you will create a program called coder.c. This program should encode and decode strings following these simple rules to encode: All uppercase characters should be lowercased before being encoded/decoded so the result will be all lowercase All special characters (punctuation, spaces, etc) should remain unchanged Characters (lowercase letters) should be shifted by X ascii value (X is entered by the user). So, for example if we want to shift by X-4 and the current character is f then the encoded character isi(+4-i). If you get to the end of the alphabet, you should wrap around to the beginning. For example, if we are shifting by Co4 and the current character is y then the encoded character should be c (y-z-a-b-c) Decoding works the same, but backwards (you subtract rather than add the offset) . In addition, your program should ask the user if they would like to encode, decode, or quit and should continue until the user selects quit. An error message should be printed if the user selects an invalid option. Welcome to the CISC 138 Code Breaker! Would you 1ike to (1) encode, (2) decode, or (3) quit? 1 How much would you like to shift by? 6 Please enter the string to encode: CAUTION!! That's no moon! Encoded Messageigazout!! zngz"y tu suutl Hould you like to (1) encode, (2) decode, or (3) quit? 2 How much was the original string shifted by? 6 Please enter the string to decode: igazout! zngz'y tu suut Decoded Message caution!! that's no moon! Would you like to (1) encode, (2) decode, or (3) quit? 6 I'm sorry, that isn't a valid input. Please try again Would you 1ike to (1) encode, (2) decode, or (3) quit? u I'n sorry, that isn't a valid input. Please try agairn Would you 1ike to (1) encode, (2) decode, or (3) quit?1

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!