Question: * * * Accepts an array of characters representing the bits in a two's complement number * and returns the decimal equivalent. * * precondition:

**
* Accepts an array of characters representing the bits in a two's complement number
* and returns the decimal equivalent.
*
* precondition:
* This method requires that the maximum length of the parameter array is 16.
*
* postcondition:
* The value returned is the decimal equivalent of the two's complement parameter.
* The parameter array is unchanged.
*
* @param theBits an array representing the bits in a two's complement number
* @throws IllegalArgumentException if the length of the parameter array >16.
* @return the decimal equivalent of the two's complement parameter
*/
public static int convert2sCompToDecimal(final char[] theBits){

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!