cd eclipse-workspace/Test2D/src into the terminal and press enter.
submit 2030 test2D Binary2.java
Implement the Binary2 class described by this API.
Make sure to read the documentation for the Bit
class.
You do not have to include javadoc comments.
You are given a minimal set of unit tests. The tests are not at all exhaustive. Feel free to modify or add your own tests.
You are also given a main method. The main method should output the following:
b : 0001
b.numberOfBits() : 4
b.getBit(3) : 1
b.toDecimal() : 1
b.setLeftmostBit(one): 1001
b.toDecimal() : 9
b2 copy of b : 1001
b2.equals(b) : true
b3 : 1001
b3.padFront(3) : 0001001
b4.compareTo(b) : 0