import java.util.Arrays; public class Hw4pr3 { // Source: http://codingbat.com/prob/p185685 /* * Given an array of ints, return true if 6 appears as either the first or * last element in the array. The array will be length 1 or more. */ public static boolean firstLast6(int[] nums) { System.out.println("****** firstLast6 ******"); // debug help System.out.println("input: " + Arrays.toString(nums)); // debug help System.out.println("Some number: " + 0); // debug help return true; // replace! } // Source: http://codingbat.com/prob/p118976 /* * * Given an array of ints, return true if the array is length 1 or more, and * the first element and the last element are equal. */ public static boolean sameFirstLast(int[] nums) { System.out.println("****** sameFirstLast ******"); // debug help System.out.println("input: " + Arrays.toString(nums)); // debug help System.out.println("Some number: " + 0); // debug help return true; // replace } // Source: http://codingbat.com/prob/p167011 /* * Return an int array length 3 containing the first 3 digits of pi, {3, 1, * 4}. */ public static int[] makePi() { System.out.println("****** makePi ******"); // debug help System.out.println("Some number: " + 0); // debug help int[] retVal = new int[3]; return retVal; // replace } // Source: http://codingbat.com/prob/p191991 /* * Given 2 arrays of ints, a and b, return true if they have the same first * element or they have the same last element. Both arrays will be length 1 * or more. */ public static boolean commonEnd(int[] a, int[] b) { System.out.println("****** commonEnd ******"); // debug help System.out.println("a: " + Arrays.toString(a)); // debug help System.out.println("b: " + Arrays.toString(b)); // debug help System.out.println("Some number: " + 0); // debug help return true; // replace } // Source: http://codingbat.com/prob/p175763 /* * Given an array of ints length 3, return the sum of all the elements. */ public static int sum3(int[] nums) { System.out.println("****** sum3 ******"); // debug help System.out.println("input: " + Arrays.toString(nums)); // debug help System.out.println("Some number: " + 0); // debug help int sum = 0; for (int i = 0; i