BinaryNum

Create a class named BinaryNum that includes an array of booleans as a property and the following methods:Implement methods that will return its decimal value, its opposite, its doubled value, its halved value, etc.  Create a binary number calculator. 

  • int toDec() - returns the value expressed as a decimal value
  • String toHex() - returns the value expressed as a hexadecimal value
  • String toString() - returns the binary value itself as a string
  • BinaryNum add(BinaryNum num1, BinaryNum num2) - returns a BinaryNum that is created from the binary sum of the BinaryNum object variables num1 and num2

Also, create a default constructor as well as an "other" constructor. Write a test class named BinaryNumTest that thoroughly tests all of the methods and constructors. The test class must be adequately annotated so its easy for the instructor to see that all the methods work correctly. The test class must first allow the user to input binary values to the keyboard. Your program must follow the class Coding Standards.

Preconditions:

    • inputed binary values and binary sums will not be greater than 111111111111

You must hand in the following on separate pages stapled in this specified order:

    1. The source code for the BinaryNum class.
    2. The source code for the BinaryNumTest class.
    3. The printscreen of your console window output. Be sure to print black text on white background.