Begin by downloading and SAVING (NOT opening) the following file found here
cd eclipse-workspace/Test2C/src
into the terminal and press enter.
submit 2030 acc Binary.java
Implement the Binary 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 : 1001 b.numberOfBits() : 4 b.getLeftMostBit() : 1 b.getRightMostBit() : 1 b.toDecimal() : 9 b.setBit(1, one) : 1101 b.toDecimal() : 13 b.setBit(0, zero) : 0101 b.toDecimal() : 5 b.toDecimal() : 5 b2 copy of b : 0101 b2.equals(b) : true b3 : 101 b3.equals(b) : true