Question: Write a java program named Coding which implements this type of code for transmit data. The transmitted data will be represented by an array of

Write a java program named Coding which implements this type of code for transmit data. The transmitted data will be represented by an array of bytes (primitive type byte). The Coding class will contain a code method that will be used by whoever sends the data: byte [] [] code (byte [] data); code will take as parameter a 1-dimensional byte array (data) which will represent the data to be transmitted. It will return a 2-dimensional array that contains the 3 copies of the table to be transmitted. For example, the table 1 2 4 11 26 15 will be transformed in a 2-dimensional array, the 3 lines of which are identical to the array to be transmitted (the 1st column, for example, will contain the 1st byte to send, followed by its 2 copies). 1 2 4 11 26 15 1 2 4 11 26 15 1 2 4 11 26 15 This table will be sent over the telecommunication line in the form 1 1 1 2 2 2 4 4 4 11 11 11 26 26 26 15 15 15 (the table will be sent column by column) and will be received under the shape of a 2-dimensional byte array. The data received will be stored in a 2-dimensional array having the same structure as the array sent. For example, if the data received is 1 1 1 2 3 2 4 4 4 14 11 14 26 26 26 15 15 15 (there were errors during transmission for numbers in red), they are listed in the table: 1 2 4 14 26 15 1 3 4 11 26 15 1 2 4 14 26 15 The Coding class will contain another method named decode which takes this array as a parameter and returns an array of dimension 1 which is assumed to be the result of the data reception (after correction of errors). byte [] decode (byte [] [] data); For the example above, the decode method will return the array that contains 1 2 4 14 26 15 (an error could not be corrected; in case of 3 different numbers one keeps one of the numbers, here that of line 0). In your program, transmission errors will be simulated. For example : data [0] [0] = 50; Sample output: The coded table if no transmission error: 1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6 The coded table received is (contains 3 errors in bold): 50 2 3 4 5 6 1 2 11 4 5 6 1 2 3 32 5 6 The corrected table is: 1 2 3 4 5 6

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!