Part I, AP Q&A
Ignore this!
Code for shell file
import java.util.ArrayList; import java.util.Arrays; import java.math.BigInteger; public class LP0 { /** * This computes the sum of a list of BigIntegers * @param a an array list of BigIntegers * @return the sum of the BigIntegers in a */ public static BigInteger sum(ArrayList<BigInteger> a) { return null; } /** * This computes the sum of all entries in an array list of integers between * low and high, inclusive. * @param a an array list of integers * @param low the low value for the trimmed sum * @param high the high value for the trimmed sum * @return the sum of all values x in the array list so * low <= x <= high. */ public static int trimmedSum(ArrayList<Integer> a, int low, int high) { return 0; } /** * This computes the product of the non-zero elements of * a and returns the sum of its digits. * @param a an array list * @return the sum of the digits in the product of the * non-zero entries in a */ public static int finger(ArrayList<BigInteger> a) { return 0; } /** * This * @param a an array list of strings * @param cut an integer, the maximum size of the substirng * you are to sample from each elemnet of a * @return a string containing the first cut characters of * elech element of the array list a concatenated together; * if any string is too short, the sample is the entire string. * examples: * ["a", "battery", "canary"], 4 -> "abattcana" * ["deadbeat", "exungulate", "foetid", "guacamole", "hi"], 5 -> * "deadbesungfoetiguacahi" */ public static String snipSample(ArrayList<String> a, int cut) { return ""; } public static void main(String[] args) { //test here System.out.println("We do test before we think a method is OK!"); } }