logo Use SA10RAM to get 10%* Discount.
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

Rajiv BhatiyaHistory

899 Answers

Hire Me
Himanshi TanwarData mining

829 Answers

Hire Me
Joan DometttData mining

878 Answers

Hire Me
Kyle BaileyFinance

649 Answers

Hire Me
C Programming

You are given a secret message and must decode it. Your secret message is this


You are given a secret message and must decode it. Your secret message is this:


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

V             000

n             001

a              010

1              011

e             100

*             101

T              110

&             111

5              00

S              01

h             10

4              11

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 ðecoder(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()


const char *encoded=”\

sa4**5nha*4n545*5h5v451 shvhTS,vhvnT4*e*Sevse4n*5*h8neh5avn4an\

T&1 s&nSSnh5e45*1 *5s4a545h*Tanvv4svsehhTTh4sni hi s4vSTe5Ta*Ts5\

Tsa4hshaTvhvnT&s*5hasv4a5sh4T&sssTen5v55Te5*54h1 sheST5ss4n54\

hvnv5sh&5T4T4hai hhnhh5ni vsvv4*T4asl *v4avT4TSa*4s55evi n5se*1 v\

411 v4sns*4n*5*h4.e4nTsv5l h4*e*s4nh4hh5i 4Tavn54ss&n5e554545Tv*\

eli naa5v4aa4sT5e5n4sv4av4aa4l hse*nv55nhh5ahl na4Tssehe*e5e55&\

aSTe5Te**Tse*nv5l aaT&vh551 1 sshhss*4545*5hvnens45vavne*shvhan\

n4*e5e5ne5h4l hi 5envSi *51 has4saTss5e55&5vT4vT5sl snl s4vevl sv\

sehahv*4n5&svš5Tsvv5s*55heTsvT&ehvnheh4l hnv5sTes*5ne*shssnv5\

se4ihvhTn*e*1 hi Shv54hal nssTs*4avh4hnvvh*T4snsTh5m5she**T5h5\

5s4sv&1 *ha*h4e&551 45haThTi n*4*4sa&5h5e55Tenh441 hhh4ee&5Tssh5\

sv55nhhvhe4l ss&nSe5nT4h4l 4sTas*i nvv4h&1 aa4l 511 55hvnhnnhaha5v\

4neTe**Tshhss4n**554nsshsvsse5evi vss*4nhave5n4sv4av45*1 sTnl 5\

5hv541 ss4hasv5s455l hashsaTnh4ass*4*ThhSnhav54aeTsa4Mshah4se\

5hT5sv55nhhv*5hsnnv5sTšs*5hTT5TTvevshhhl s&she*h&ve554Tsl 1 T4h\

*n5vshehT4h5ev5h41 4sThh85h5hvnTs*e*s4sv4*SshehT4e454hss4vh\

vna4h45*nv5l hi shh5l vsi seshT5avneashssnvv4hsne*i *sl 1 e4asl hese

*s5h54ay*54T&hRnne*i h45Tsa&5h5e5nhe*h&vevi Sn5evl hs*hss\

sell shn4a*hsv4nssehvh5vTnhT44l hsnh4e4na4ha5e5n*&shsh5hvnTh5T\

e5Tsaa55l 5&s45eTsaTv*Tenv5shsss*h54Ta4hs*heh4vaT4eaS5vl s5nas\

eTshhsl na4l 5seenvvT&*eT5hvn4anhenhsaa5vT5eTss 1 va&sa4*v4aa45T\


char decoded[1000];

decoder(encoded, decoded, sizeof(decoded));

printf(“%s”, decoded);

return 0;


Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme

Get Free Quote!

394 Experts Online