/** * Dave Slemon's Tools * * @author Dave Slemon * @version v100 */ public class Tools { /** * This routine converts a string to an integer * @author: Dave Slemon * @version: v1.00 * * @param str is a numeric string * @return a integer representation of the str */ public static int convert_string_to_integer(String str) { return Integer.parseInt(str); } /** * This routine returns the middle number of 3 string numbers * @author: Dave Slemon * @version: v1.00 * * @param a is a numeric string * @param b is a numeric string * @param c is a numeric string * @return an integer representation of the middle number */ public static int middle(String a, String b, String c) { int x = convert_string_to_integer(a); int y = convert_string_to_integer(b); int z = convert_string_to_integer(c); return middle(x,y,z); } /** * This routine returns the middle number of 3 string numbers * @author: Dave Slemon * @version: v1.00 * * @param a is an integer number * @param b is an integer number * @param is an integer number * @return an integer representation of the middle number */ public static int middle(int x, int y, int z) { //middle int big, small; int sum = x + y + z; big = Math.max(x,y); big = Math.max(big,z); small = Math.min(x,y); small = Math.min(small,z); return sum - big - small; } //middle }