public static int evens(int low, int high) { int sum = 0; for (int num=low; num<=high; num++) if (num % 2 == 0) sum += num; return sum; } --- /** compute the sum fo the even numbers between two values @param low the number to start with @param high the number to end with, ASSUMES low <= high @return the sum of the even numbers */ --- System.out.println(evens(1, 100)); --- BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public static int countchar(char it) { int count = 0; char current; do { current = (char) br.read(); count++; } while (current != it); return count; } --- 2.5 5.6 3.4 2.3 12345 45 --- public --- static --- void --- 3x4x5 $0.0 for Dr. H 10x20x30 $20.5 for Manny 10x20x30 $20.5 for Manny 3x4x5 $0.0 for Moe 3x4x5 $10.0 for Jack --- public double changeMax(double num) { if (num <= MAXCOST) cost = num; return cost; } --- Gift [] presents = new Gift[10]; --- presents[0] = new Gift(); --- presents[9] = new Gift(5, 7, 9, 43.24, "myself"); // or presents[presents.length-1] = new Gift(5, 7, 9, 43.24, "myself"); --- presents[0].printall(); --- Random R = new Random(); int num = Math.abs(R.nextInt())%8+13; System.out.println(num);