Question: When a message is transmitted in secret code over a transmission channel, it is usually transmitted as a sequence of bits, i.e., Os and Is.

 When a message is transmitted in secret code over a transmission

When a message is transmitted in secret code over a transmission channel, it is usually transmitted as a sequence of bits, i.e., Os and Is. Due to noise in the transmission channel, the transmitted message may become corrupted This means that the message received at the destination is not the same as the message transmitted, some of the bits may have been changed There are several techniques to check the validity of the transmitted message at the destination. One technique is to transmit the same message twice. At the destination, both copies of the message are compared bit-by-bit. If the corresponding bits are the same, the message received is error-free. Write a Java program that implements a readCode method and compareCode method to check whether the message received at the destination is error- free Assume that the secret code representing the message is a sequence of digits (0 to 9) and the maximum length of the message is 250 digits. Also, the first number in the message is the length of the message. For example, if the secret code is: 7 9 2 7 8 3 5 6 then the message is 7 digits long, and it is transmitted twice. The above message is transmitted as: 7 9 2 7 8 3 5 6 7 9 2 7 8 3 5 6 Use the following files: The input file called SecretCode.txt contains the secret code and its copy: 7 9 2 7 8 3 5 6 7 9 2 7 8 3 5 6 The output file called SecretCodeOut.txt should contain 2 columns of digits labeled Code Digit and Code Digit Copy along with the message underneath both 2 columns that reads: "Message transmitted OK" Print out both input and output files along with your source code

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!