public class YourNameProg3 { // pass the number you wish to display private void displayBits(int number) { System.out.print(number + "\t"); for (int bit=31; bit>=0; bit--) { char ch = (((1 << bit) & number) != 0) ? '1' : '0'; System.out.print(ch); if (bit % 4 == 0) { System.out.print(' '); } } System.out.println(); } private void displayNegPosPows(int number) { displayBits(number); if (number > 0) { displayNegPosPows(number>>1); displayBits(-number); } } // ask the user for a number // your code here private int getUserNumber() { return 127; } public void run() { displayNegPosPows(128); // ask user for number // your code here displayBits(getUserNumber()); } public static void main (String[] args) { new Prog3().run(); } }