1. false true true 2. public class Question2 { public static int localMaximum(int[] a) { for (int i = 1; i < a.length-1; i++) { if (a[i] > a[i+1] && a[i] > a[i-1]) return i; } return -1; } public static void main(String[] args) { int[] a = new int[args.length]; for (int i = 0; i < a.length; i++) { a[i] = Integer.parseInt(args[i]); } System.out.println(localMaximum(a)); } } 3. public class EditorModel { private char[] text; public EditorModel(int n) { text = new char[n]; for (int i = 0; i < n; i++) { text[i] = ' '; } } public void insert(int i, char c) { for (int j = text.length-1; j > i; j--) { text[j] = text[j-1]; } text[i] = c; } } 4. public static void findMaxSeq(int[] a) { int max = 0; int start = 0; int end = 0; for (int i = 0; i < a.length; i++) { int j = i+1; while (j < a.length && a[j] >= a[j-1]) j++; if (max < j-i) { max = j-i; start = i; end = j-1; } } System.out.println(start+" "+end); } 5. public static List getReservations(String name) throws FileNotFoundException { List reservations = new ArrayList(); Scanner s = new Scanner(new File("reservations.txt")); while (s.hasNext()) { String name1 = s.next(); int n = s.nextInt(); for (int i = 0; i < n; i++) { String code = s.next(); if (name.equals(name1)) reservations.add(code); } } return reservations; }