public class W03N01Collapsed { public static void main( String[] args) { // declare variables double d; double mod; // get number d = IO.readDouble("Your number: "); // if d is negative if (d < 0) { // print message that it was negative System.out.println(d + " is negative."); } // if the users number is between 0 and 100, inclusive, // if the number is <= 100 else if (d <= 100) { // can't collapse -- follows an if, not an else // if it is >= 0 if (d >= 0) { // print it. System.out.println("Input number, " + d + ", between 0 and 100 inclusive"); } // otherwise do nothing else { ; } } // otherwise else { // modulate the number mod = d % 100; //can't collapse. Follows a statement, not an else // if the modulated result is between 50 and 100 (non-inclusive) // I already know mod is < 100, by the definition of modulo, so // if modulated result > 50 it is in the range I want to print if (mod > 50) { System.out.println("modulated number " + d + " is between 50 and 100"); } // otherwise do nothing else { ; } } } }