Question 1. 1 8 0 8 2 0 1 5 Question 2. public class Question2 { public static int getRangeSize(int[] a) { if (a.length == 0) return 0; int min = Integer.MAX_VALUE; int max = Integer.MIN_VALUE; for (int i = 0; i < a.length; i++) { if (min > a[i]) min = a[i]; if (max < a[i]) max = a[i]; } return (max-min); } public static void main(String[] args) { int a[] = new int[args.length]; for (int i = 0; i < args.length; i++) { a[i] = Integer.parseInt(args[i]); } System.out.println(getRangeSize(a)); } } Question 3. public class Turtle { int x, y; Direction dir; public Turtle() { x = 0; y = 0; dir = Direction.NORTH; } public void turnLeft() { switch (dir) { case NORTH: dir = Direction.WEST; break; case SOUTH: dir = Direction.EAST; break; case EAST: dir = Direction.NORTH; break; case WEST: dir = Direction.SOUTH; break; } } public void forward(int steps) { switch (dir) { case NORTH: y += steps; break; case SOUTH: y -= steps; break; case EAST: x += steps; break; case WEST: x -= steps; break; } } } Question 4. public static void shuffle(int[] a) { for (int i = a.length-1; i > 0; i--) { int j = (int) (Math.random()*(i+1)); int tmp = a[i]; a[i] = a[j]; a[j] = tmp; } } Question 5. public static List loadStudents(File file) throws FileNotFoundException { List students = new ArrayList(); Scanner scanner = new Scanner(file); while (scanner.hasNext()) { String name = scanner.next(); Student student = new Student(name); int courses = scanner.nextInt(); for (int i = 0; i < courses; i++) { String course = scanner.next(); int grade = scanner.nextInt(); student.addCourse(course,grade); } students.add(student); } return students; }