Programming Assignment 1
Java Requirements

Call your file Arithmetic.java. Implement the following class and static methods. The following comments apply to all of them.

All integers are stored in binary as arrays of bits, with the least significant bit stored at index 0.

All results are required to be normalized, meaning that the most significant bit is 1. The number 0 should have size 0. So you will need to ensure that the size of the result array is exactly right. (Yes, you can create an array of size 0.)

public class Arithmetic
{
  //=================================================================
  // inc(A) returns an array of bits representing A+1.
  //=================================================================

  public static byte[] inc(byte[] A)
  {
    ...
  }

  //=================================================================
  // sum(A,B) returns an array of bits representing A+B.
  //=================================================================

  public static byte[] sum(byte[] A, byte[] B)
  {
    ...
  }

  //=================================================================
  // product(A,B) returns an array of bits representing A*B.
  //=================================================================

  public static byte[] product(byte[] A, byte[] B)
  {
    ...
  }
}

You can add any number of private static methods.

**Note** Please do not include a package line. If there is a package line, then I must either put your file into a directory whose name matches your package name or I must remove the package line. If your IDE (such as Eclipse) puts in a package line, just remove it in the version that you submit.