Question: Problem Assume you are working as a programmer in a communication field. Your task is to alter the original data before transmitting because of a

 Problem Assume you are working as a programmer in a communication

Problem Assume you are working as a programmer in a communication field. Your task is to alter the original data before transmitting because of a security reason. All of their data is an integer that contains the number of digits between two and eight (inclusive), thus the possible integers are between 10 and 99999999. You have to read in an integer and complete the following stages Stage 1: Your task is to modify the data for transmission according to the following set of rules 1. If the number is a two digit number you swap the positions of the numbers (eg: if the number is 56, altered number is 65) 2. If the number is a three digit number, digits at positions 1 and 3 are swapped (eg: number is 123, altered number is 321) 3. If the number is four digits or above the following rules apply Replace the first digit by the remainder after the sum of that digit plus 1 is divided by 10, the second digit by the remainder after the sum of that digit plus 2 is divided by 10, third digit by the remainder after the sum of that digit plus 3 is divided by 10, fourth digit by the remainder after the sum of that digit plus 4 is divided by 10 and so on Position of the number is counted from right to left. 3 Position 8 Position7 Position 3 Position 2 Position 1 Stage 2: Extra protection (done only on 8 digits numbers - if the user chooses this option) Eight digit data contains more valuable information, so you are asked to enable extra protection if the user chooses to The extra protection is done on modified number in stage one by swapping the digit in position 1 with digit in position 8, digit in position 2 with digit in position 7, digit in position 3 with digit in position 6, digit in position 4 with digit in position 5 If the modified number in stage 1 is as shown below: 4 6 The number after stage 2 will look like 4 2 Stage 3: (Decodin Once the encoding stages are over, write the codes to recover your original data from the encoded data

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!