Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The decryption part is not important. I need a piece of code that can solve any problem You are given a secret message and must

image text in transcribedimage text in transcribed

The decryption part is not important. I need a piece of code that can solve any problem

You are given a secret message and must decode it. Your secret message is this: V51aaT&vh -5h41h15eny sv&5TsVvE 15 .VOS 14 is*4av in*4*4 STA v. sv4av4 aeTsa4h th&ve554 hT4e nT. neas -a55v10 Yes, it's in a secret code. But, you know the secret. Each character in the message equals some bits in the output string. Your code is this: Code Bits 000 n 001 010 011 100 101 110 111 00 01 5 10 11 ISHOIDOSSO Lite de la Each character becomes some bits. For example, supposed you got the codes for these bits: 010 010 00 01 10 010 101 101 100 01 101 100 011 011 110. If you think of those as sequential bits, most significant bit first, you can group them in groups of 8 and you get this: 01001000 01100101 01101100 01101100 01101111 0. Those turn out to be the ASCII codes for "Hello". All you have to do is read the code one character at a time, and generate the bits for the decoded output as a character string. The function you will fill in will be this: * Decode an encoded string into a character stream. * @param encoded The input string we are decoding * @param decoded The output string we produce * @param maxLen The maximum size for decoded void decoder (const char *encoded, char *decoded, int maxlen) Here is a simple main program to test that your solution works. Note that this does not test every possible way the program may be used, but if your solution works you will get an output string that is English, not gibberish. int main() *h&1 ShaTv nunv5sh&5 VSV 4*es 41hsex 0413 45Tsvvs: 15hv54h s5145h 5e5nT4 -nas- e554 .f4e45 s1104 Svsheh ers4 vasa4 char decoded[1800); decoder (encoded, decoded, sizeof(decoded)); printf("%s", decoded); return

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visualizing Health And Healthcare Data Creating Clear And Compelling Visualizations To See How Youre Doing

Authors: Katherine Rowell ,Lindsay Betzendahl ,Cambria Brown

1st Edition

1119680883, 978-1119680888

More Books

Students also viewed these Databases questions