Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Business Law & Ethics Expert


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.

Business Law & Ethics, Finance

  • Category:- Business Law & Ethics
  • Reference No.:- M9506635

Have any Question?


Related Questions in Business Law & Ethics

Australian commercial law assessment - part a 300 words -in

AUSTRALIAN COMMERCIAL LAW ASSESSMENT - PART A (300 words) - In using the resources of the early Modules, your tribe discussed and developed a constitution. In the new constitution assume that there are rules protecting a ...

Managing the legal environment assignment - research

MANAGING THE LEGAL ENVIRONMENT ASSIGNMENT - RESEARCH PROJECT Company: Nike (a) Summarise in about 250-500 words the characteristics/features of the organisation (you can choose a statutory/government body or select a bus ...

Question 1it has been said that good corporate governance

Question 1 It has been said that good corporate governance is an important ingredient in corporate success and that regulators should encourage good corporate governance. Required Discuss how good corporate governance is ...

Assessment taskassignment questiondiscussi the main ways

Assessment Task Assignment question: Discuss: i. the main ways that a company may source finance; and ii. the benefits and costs associated with the main sources of corporate finance. Guidance - Students are to read text ...

Business law assignment question -mabo has been said to a

BUSINESS LAW ASSIGNMENT QUESTION - Mabo has been said to a cornerstone of the Australian legal system. Your response must discuss the following: 1. Discussion of the Mabo (No 2) case. 2. Explain the impacts of the case o ...

Corporations law - assignment questions -objectives -

CORPORATIONS LAW - ASSIGNMENT QUESTIONS - Objectives - Answer the following questions with reference to the relevant statute law and general common law principles operating in Australia concerning the consequences of the ...

Australian commercial and corporations law assignment -this

Australian Commercial and Corporations Law Assignment - This assignment deals with critical problem solving skills. This assessment tests course objectives addressing: Knowledge of relevant law, Application of the law to ...

Assessment descriptionyou are required to watch the

Assessment Description You are required to watch the following YouTube clips from the GRI Secretariat: 1. The GRI Sustainability Reporting Standards: The Future of Reporting 2. Introducing the GRI Standards You must also ...

Introduction to business law assessment -case - garcia v

INTRODUCTION TO BUSINESS LAW ASSESSMENT - CASE - Garcia v NAB Introduction of relevant background of the issue, explanation and setting out the argument/theme, key issues and the structure that follows. Identification of ...

Group report1 this group assignment consists of 2 parts

GROUP REPORT 1. This group assignment consists of 2 parts. Part A is a case study on contract law, and Part B is a question involving Corporations Law. Both questions must be answered. 2. The total word limit for the gro ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As