pawan, Business Law and Ethics

Assignment Help:

Decode the Code
Problem Description
Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are sending their messages in a number format. This format represents the way that numbers and characters are padded on mobile’s keypad. One smuggler sends a text message to the second smuggler, using the numbers corresponding to the letters on the keypad. When the receiving smuggler gets the message, he simply opens the “create text message” function in his mobile and types the number string. This way the receiver finally reads the original message. For Example: - 6999066263304447777077766622337778 -----> message sent by the first smuggler. my name is robert---------> message decoded by the second smuggler. Where ‘0’ denotes the "space".

Explanation: By pressing ‘6’ (i.e. key’6’ one time) on the keypad, the mobile shows ‘m’ on display screen in write text message area. By pressing ‘999’ (i.e. key ‘9’ three times) on the keypad, the mobile shows ‘y’ on display screen in write text message area. By pressing ‘0’ (i.e. key ’0’ one time) on the keypad, the mobile shows ‘space’ on display screen in write text message area. By pressing ‘66’ (i.e. key’6’ two times) on the keypad, the mobile shows ‘n’ on display screen in write text message area. By pressing ‘2’ (i.e. key ’2’ one time) on the keypad, the mobile shows ‘a’ on display screen in write text message area. By pressing ‘6’ (i.e. key ''6''one time) on the keypad, the mobile shows ‘m’ on display screen in write text message area. By pressing ‘33’ (i.e. key ‘3’ two times) on the keypad, the mobile shows ‘e’ on display screen in write text message area. By pressing ‘0’ (i.e. key ‘0’ one time) on the keypad, the mobile shows ‘space’ on display screen in write text message area. By pressing ‘444’ (i.e. key’4’ three times) on the keypad, the mobile shows ‘i’ on display screen in write text message area. By pressing ‘7777’ (i.e. key ’7’ four times) on the keypad, the mobile shows ‘s’ on display screen in write text message area. By pressing ‘0’ (i.e. key ‘0’ one time) on the keypad, the mobile shows ‘space’ on display screen in write text message area. By pressing ‘777’ (i.e. key ’7’ three times) on the keypad, the mobile shows ‘r’ on display screen in write text message area. By pressing ‘666’ (i.e. key ’6’ three times) on the keypad, the mobile shows ‘o’ on display screen in write text message area. By pressing ‘22’ (i.e. key ‘2’ two times) on the keypad, the mobile shows ‘b’ on display screen in write text message area. By pressing ‘33’ (i.e. key ‘3’ two times) on the keypad, the mobile shows ‘e’ on display screen in write text message area. By pressing ‘777’ (i.e. key ’7’ three times) on the keypad, the mobile shows ‘r’ on display screen in write text message area. By pressing ''8'' (i.e. key ’8’ one time) on the keypad, the mobile shows ‘t’ on display screen in write text message area.
But for word monkey 6#666#665533999 this string will be sent by the smuggler one Here ‘# ‘ denotes that if smuggler watches ‘#’ then it means character previous to # is on the same key to the character after the ‘#’ and smuggler has to wait for 2 seconds and then press the same key.
Explanation: By pressing ‘6’ i.e. key’6’ one time on the keypad, the mobile shows ‘m’ on display screen. For ''#'' wait for 2 seconds, and then press next. By pressing ‘666’ i.e. key’6’ three times on the keypad, the mobile shows ‘o’ on display screen. For ‘#’ wait for 2 seconds, and then press next. By pressing ‘66’ i.e. key’6’ two times on the keypad, the mobile shows ‘n’ on display screen. By pressing ‘55’ i.e. key’5’ two times on the keypad, the mobile shows ‘k’ on display screen. By pressing ‘33’ i.e. key’3’ two times on the keypad, the mobile shows ‘e’ on display screen. By pressing ‘999’ i.e. key’9’ three times on the keypad, the mobile shows ‘y’ on display screen.
*Here lower case doesn’t matter. *Assuming that the smuggler one will not send any numeral characters in the original message. For example smuggler will not send any message like "I need 1000 bucks" as it contains numerals. So policemen need your help to track the smugglers. You have to write a program that decodes the sending smuggler’s string (from the number format into plain text).
Instructions to work with Open PBT Client:
Specify the work directory path in the ''Work directory Path'' field. The path should correspond to your solution Work directory.
Download the support files by clicking the Get Dev Files.
You will find the problem directories containing:
problem.h file
problem.c file
in your project directory.
Code the solution in .c file inside the problem directory
All required files will be downloaded to your work directory. Creating additional files is strongly discouraged.
Step 1:
In your Solution File:
Implement your logic in function char* decodeCode(char* encodedString)
char*   encodedString : is string which is sent by the smuggler1.
You can create more functions if required, but those functions should be in the same file.

Step 2:
In your solution keep in mind the following constraints.
In this problem you have to write a program that decodes the string, which is sent by the first smuggler.
The function decodeCode() takes the string encodedString as an argument. That string is what the first smuggler sends to the second smuggler.
The function decodeCode() returns a string, which is the decoded string in plain text.
If encodedString is empty then returns empty string.
encodedString should only contain integers, and the special character ''#'' (if needed).
encodedString should not have any alphabetic character (e.x. ''a'',''b'') else return empty string
encodedString should not have any special character except ''#'' else return empty string
The Prototype of the function is
char* decodeCode(char* encodedString) This function takes following argument.
char*    encodedString:  which represents the string which is send by the smuggler1.
function decodeCode() will return a string which is the decoded string of that string which is send by the smuggler1.
The constraints are:
encodedString should only contain integers, and the special character ''#'' (if needed).
encodedString should not contain any alphabetical characters (e.x. ''a'', ''b''); otherwise return empty string
encodedString should not contain any special characters, except ''#''; otherwise return empty string
encodedString is empty then returns empty string.

Related Discussions:- pawan

State the theories of self-enforcing, Theories of self-enforcing or implici...

Theories of self-enforcing or implicit contracts These theories relate to the problem of limits to which legal compulsion can be employed (due to information or transaction cos

Appointment of arbitrators, Appointment of Arbitrators However under s...

Appointment of Arbitrators However under sec 12(1) the parties are free just for agree on the procedure of appointing arbitrators. Therefore under sec 31(1) the parties are

State article 10 of air and outer space law, State Article 10 of air and ou...

State Article 10 of air and outer space law Article 10 allows the aircraft to cross the territory of a contracting State without landing, and further states that every aircraft

Explain abraham maslow''s hierarchy of needs, Question 1 Mention any ten r...

Question 1 Mention any ten recommendations made by the Honey report Question 2 Explain the following Staff and line Span of Control Question 3 Explain A

What is the use of self defence, What is the  use of self defence The ...

What is the  use of self defence The controversy regarding the use of self defence is the 'anticipatory self-defence'. Those with a restrictive view state that it no longer e

Case law relating to dividends, Case Law Relating To Dividends: The ab...

Case Law Relating To Dividends: The above provisions of Table A supplement the following common law rules: 1)      Losses in previous years need not be provided for. Furthe

Explain ethics & financial reporting , Pat Clark is the controller for Best...

Pat Clark is the controller for Best Pharma, a publicly-held pharmaceuticals manufacturer in Wilmington, Delaware.  In early December 2011, Pat's boss, CEO Bernie Skilling, approac

Lost by company personnel, In a business context, there are thousands of le...

In a business context, there are thousands of legal claims that happen frequently in a company's course of operations. Frequently, the management team must come to together to veri

Law of negligence not every error is negligence, Every person is having dif...

Every person is having different set of knowledge and skill with them which is different from other individual, this difference in skill and knowledge factor among various individu

Article 3 - state responsibilty, Article 3 - State Responsibilty Artic...

Article 3 - State Responsibilty Article 3. This article is about the Characterisation of an act of a State as Internationally wrongful. A local law that results into violatio

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd