cd eclipse-workspace/Test2F/src into the terminal and press enter.
submit 2030 test2F Binary4.java
Implement the Binary4 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.getBit(2) : 0
b.toDecimal() : 9
b.setLeftmostBit(0) : 0001
b.toDecimal() : 1
b2 : 1
b2.safeGetBits() : [1]
b3 : 1001
b3.shiftLeft(3) : 1000
b3.toDecimal() : 8