Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program in java language to implement the checksum method. The implement

ID: 3571298 • Letter: W

Question

Write a program in java language to implement the checksum method.

The implementation has two parts: a. Calculating the checksum at the sender

b. Verifying the checksum at the receiver Calculating the checksum at the sender Inputs: 4 data each consisting of 16-bit (binary) Output: Checksum of 16-bit (binary

Example: http://mathforum.org/library/drmath/view/54379.html

For example, suppose we have the following data. I separate the data into groups of 4 bits only for readability. 1000 0110 0101 1110 1010 1100 0110 0000 0111 0001 0010 1010 1000 0001 1011 0101

Verifying the checksum at the receiver Inputs: 4 data each is consisting of 16-bit and their 16-bit checksum Output: Checksum for 4 data each is consisting of 16-bit and their 16-bit checksum If checksum is equal to 0s, your data is not corrupted If checksum is not equal 0s, your data is corrupted

Explanation / Answer

public static void main(String[] args) throws Exception
{
String a = "1000011001011110";
String b = "1010110001100000";
String c = "0111000100101010";
String d = "1000000110110101";
int aa = Integer.parseInt(a, 2);
int bb = Integer.parseInt(b,2);
int cc = Integer.parseInt(c,2);
int dd = Integer.parseInt(d,2);
int f = aa + bb + cc + dd;
Integer.toBinaryString(f)
while (f!=0)
{
int digit = f%2;
buf.append(digit);
f=f/2;
}
buf.reverse();

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote