import element.*; public class Predicates { public static boolean between(double a, double b, double c) // post: returns true iff a <= b <= c { return (a <= b) && (b <= c); } public static boolean isLower(char c) // post: returns true if c is a lower case letter { return ('a' <= c) && (c <= 'z'); } public static boolean between(char a, char b, char c) // post: returns true if a <= b <= c in the ASCII ordering { return (a <= b) && (b <= c); } public static boolean isUpper(char c) // post: return true if c is an uppercase letter { return between('A',c,'Z'); } public static void main(String args[]) { DrawingWindow d = new DrawingWindow(); ConsoleWindow c = new ConsoleWindow(); int x, y; int i; String greeting = "Hello, World."; for (x = 0; x < d.bounds().right(); x++) { for (y = 0; y < d.bounds().bottom(); y++) { if (old.between(x*0.5, y*1.0, x*1.0)) { d.draw(new Pt(x,y)); } } } for (i = 0; i < greeting.length(); i++) { c.out.println(greeting.charAt(i)+": lower? " +isLower(greeting.charAt(i))+" "+ between('a',greeting.charAt(i),'z')); } // System.exit(0); } } class old { public static boolean between(double a, double b, double c) // post: returns true if a <= b <= c { if ((a <= b) && (b < c)) return true; else return false; } }