import java.util.*; /* * Test program for PS 2, problem 7. * * Put this program in the same folder as your FunArray.java. * * If it doesn't compile, that means that one or more of your methods * does not have the correct header -- i.e., either the name, the * return type, or the parameters are incorrect. * * The correct results to these method calls are given in the assignment. * * These tests may not cover every case. We encourage you to add additional * test cases. */ public class FunArrayTest { public static void main(String[] args) { int[] vals1 = {1, 3, 5, 7}; int[] vals1Reordered = {1, 3, 7, 5}; int[] vals2 = {2, 4, 6, 8}; int[] vals3 = {-1, -2, -3, -4, -5, -6}; System.out.println("** part 1, example 1**"); System.out.println(FunArray.firstX(vals1, 7)); System.out.println(); System.out.println("** part 1, example 2**"); System.out.println(FunArray.firstX(vals1, 4)); System.out.println(); System.out.println("** part 2 **"); FunArray.histogram(vals1Reordered); System.out.println(); System.out.println("** part 3 **"); System.out.println(Arrays.toString(FunArray.reverse(vals1))); System.out.println(); System.out.println("** part 4, example 1 **"); System.out.println(Arrays.toString(FunArray.interleave(vals1, vals2))); System.out.println(); System.out.println("** part 4, example 2 **"); System.out.println(Arrays.toString(FunArray.interleave(vals1, vals3))); System.out.println(); } }