//  Data Structures with Java by John R. Hubbard
//  Copyright McGraw-Hill, 2001
//  Example 1.4 on page 5
//  Using conditional statements

public class Ex0104
{ public static void main(String[] args) 
  { int n = (int)Math.round(100*Math.random());
    System.out.println("n = " + n);
    if (n>25 && n<75) System.out.println(n + " is between 25 and 75");
    else System.out.println(n + " is not between 25 and 75");
    switch ((int)n/20)
    { case  0: System.out.println(n + " < 20");
      case  1: System.out.println(n + " < 40");
      case  2: System.out.println(n + " < 60");  break;
      case  3: System.out.println(n + " < 80");  break;
      default: System.out.println(n + " >= 80");
    }
    System.out.println(n + (n%2>0 ? " is odd" : " is even"));
  }
}
