Question: the code must be in java. not allowed to use inbuild fuctions like parseint, toarray.... the only thing that is allowed is it would return
* representing the bits in the 16 bit two's complement equivalent, * precondition: * This method requires that the two's complement equivalent * won't require more than 16 bits * * eparan theDecimal the decimal number to convert to 2 's complement * ethrogs IllegalArgumentException if the parameter cannot be represented in 16 bits * ereturin a 16 bit two's complement equivalent of the decimal parameter */ public static char [] convertDecimalTo2scomp(final int theDecimal) f int number=Math.abs(theDecimal); int lenath=0; return null; // Replace the null return value with a correct return value. /* * NOTE: If you wish, you may also include private helper methods in this class. */
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
