I need the code for a Java programming project. Allow the user to type in a integer or floating point decimal number. calculate and display the binary equivalent. Use 2’s complement for negative numbers. For floating point numbers use simplified format Solution Answer: import java.io.*; class ComplementProgram { public static void main(String args[]) throws IOException { int read[]=new int[32]; int input1,input2,i=0,carryflag=0,j=0,k=0,m,n; BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); input1=Integer.parseInt(br.readLine()); input2=input1; i=31; while(input1!=0) { read[i]=Math.abs(input1%2); input1=input1/2; i=i-1; } while(i>=0) { read[i]=0; i=i-1; } System.out.println(\"\"); for(k=0;k<32;k++) System.out.print(read[k]); if(input2<0) { for(i=0;i<32;i++) { if(read[i]==1) read[i]=0; else read[i]=1; } carryflag=1; for(i=31;i>=0;i--) { if(read[i]==1 && carryflag==1) { carryflag=1; read[i]=0; } else if(carryflag==1) { read[i]=1; carryflag=0; break; } } } System.out.println(\"\"); if(input2<0) { System.out.println(\"The 2\'s Complement of a positive number is:\"); for(k=0;k<32;k++) System.out.print(read[k]); } else System.out.println(\"For this number there is no 2\'s complement\"); } }.