Question: Please help me fix my CRC java code. I don't know why its giving me wrong answers. import java.util.*; import java.lang.*; import java.lang.Number; import java.math.BigInteger;

Please help me fix my CRC java code. I don't know why its giving me wrong answers.

import java.util.*; import java.lang.*; import java.lang.Number; import java.math.BigInteger; public class CyclicRedundancyCheck { public static void main(String[] args) throws NumberFormatException { Scanner sc = new Scanner(System.in); System.out.println("Please make sure all data being entered is in binary form (ie 101101)"); System.out.println(" "); System.out.print("Enter your Row Information Code: "); String code = sc.next(); System.out.println(" "); System.out.print("Enter the polynomial: "); String polynomial = sc.next(); System.out.println(" ");

// Ammount of 0's to be appended int r = (polynomial.length()); String newcode = code; for(int i=1; i

//C is our check value BigInteger C = new BigInteger("0",2);

System.out.println("The check sum is = " + (R.toString(2)));

//Check to see if remainder is 0 if (R.equals(C)) { System.out.println("Checksum is zero, therefore, no transmission error"); }

else { System.out.println("Checksum is not zero, therefore, some transmission error occurred"); }

} }

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!