Question: Please make it concise and clean. I want to be able to read and understand it without having to be confused as to what i'm
Please make it concise and clean. I want to be able to read and understand it without having to be confused as to what i'm reading. just keep it clean and neat for visual studio C++.
You've been hired by Covert Cryptos to write a C++ console application that encodes and decodes text. Use a validation loop to prompt for and get from the user a string that is up to 15 characters in length. Create function encodedString that takes the string as input and returns the equivalent encoded string. The function starts with an empty encoded string. It then encodes each character of the input string per the following algorithm and appends the encoded character to the encoded string. To encode each character of the input string:
Convert the character to an integer.
Add 45 to the integer value.
Mod the integer value by 255 to insure its stays within the character range
0-255.
Convert the integer back to a character.
Create function decodedString that takes the encoded string as input and returns the equivalent decoded string. It does the reverse of function encodedString. The original string and decoded string should be identical. Format the following three outputs into two formatted columns:
Input string.
The encoded string (some characters may be unprintable).
The decoded string.
The first column is a left-justified label. The second column is a left-justified string. Use formatted output manipulators to print the output. Declare and use global constants for the maximum string length (15), the shift value (45), the character boundary (255), and the column widths. Continue to prompt the user for strings until they enter a sentinel value of "z". Maintain a count of the number of encodings (loops) performed and print it before the application close. For strings Hello World! and WSU is great., the output should look like this:
Welcome to Covert Cryptos
-------------------------
Enter a string up to 15 characters in length to encode (z to
exit): Hello World!
String: Hello World!
Encoded string: uMN
Decoded string: Hello World!
Enter a string up to 15 characters in length to encode (z to
exit): WSU is great.
String: WSU is great.
Encoded string: MM[
Decoded string: WSU is great.
Enter a string up to 15 characters in length to encode (z to
exit): z
Encodings performed:2
End of Covert Cryptos
Loop the program five times with different input strings.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
