import becker.io.*; // don't actually need this for the in-class exercise

class ReviewHelper extends Object
{
	// Exercise #1:
	// this method should print out the entire array that it's been given.
	public void printArray(?????????????????  ) //TODO: what do you want to put in here?
	{
		// TODO: Draw out the graph
	}
	
	// Exercise #2:
	// This method should take two parameters:
	// 1) An array that you want to print part of
	// 2) An integer, which is how many elements to print out
	// The method should print out that many elements of the array
	// So if you're given the code in main:
	//
	// 	rh.printPartOfArray(nums, 2);
	//
	//	Your code should print out 3, then 13
	public void printPartOfArray()
	{
	}
	
	// **************************************************************************
	// Exercise #3:
	// This method should take two parameters:
	// 1) An array that you want to print part of
	// 2) A boolean (true/false value), which tells you whether 
	// 	you should print out the even #'d spaces (true), or the
	//		odd #'d spaces (false)
	//
	// So if you're given the code in main:
	//
	// 	rh.printPartOfArray(nums, true);
	//
	//	Your code should print out 3, then 5, then 2 (i.e., spaces 0, 2, and 4)
	// So if you're given the code in main:
	//
	// 	rh.printPartOfArray(nums, false);
	//
	//	Your code should print out 13, then 7 (i.e., spaces 1 and 3)
	public void printEveryOther(??????)
	{
		
	}

	// **************************************************************************
	// Exercise #4:
	// This method should take one parameter:
	// 1) An array that you want to total up
	//
	// This method should take return one value:
	// 		The total (summation) of all the elements in the array
	//
	// So if you're given the code in main:
	//
	// 	int total = rh.sum(nums);
	//		System.out.println("total is: " + total);
	//
	//	Your method should return 30 (3+13+5+7+2=30), and the next line should
	// print the message "total is: 30"
	public int sum(??????)
	{
		
	}

	// **************************************************************************
	// Exercise #5:
	// This method should take one parameter:
	// 1) An array that you want to total up
	//
	// This method should take return one value:
	// 		The LARGER of 
	//				(1) The total (summation) of all the elements in the array
	//				(2) The largest total of all the other arrays you've previously totaled up
	//
	// So if you're given the code in main:
	//
	//	 	total = rh.sumMax(nums);
	//		System.out.println("total is: " + total); // 30
	//	 	total = rh.sumMax(moreNums);
	//		System.out.println("total is: " + total); // 65
	//	 	total = rh.sumMax(nums);
	//		System.out.println("total is: " + total); // still 65
	//
	//	Your method should return (and then have _main_ print) the values
	// listed in the comment next to the line.
	public int sumMax(??????)
	{
		
	}
	
	// **************************************************************************
	// Exercise #6:
	// This method should take no parameters, and return no values
	//	The purpose of this method is to 'reset' the instance variable
	// used by sumMax back to zero, so that the following code
	// should return (and then have _main_ print) the values
	// listed in the comment next to the line.
	//
	// So if you're given the code in main:
	//
	//	 	total = rh.sumMax(nums);
	//		System.out.println("total is: " + total); // 30
	//	 	total = rh.sumMax(moreNums);
	//		System.out.println("total is: " + total); // 65
	//	 	total = rh.sumMax(nums);
	//		System.out.println("total is: " + total); // still 65
	//		rh.resetSumMax();	
	//	 	total = rh.sumMax(nums);
	//		System.out.println("total is: " + total); // once again 30
	//
	public int resetSumMax(??????)
	{
		
	}

	// **************************************************************************
	// Exercise #7:
	// This method should take two parameters:
	// 1) An array that you want to compare to ...
	//	2) the other array.
	//
	// This method should take return one value:
	// 		The total number of spaces that contain the same value
	//
	//	Note that the arrays might not be the same length,
	// so you'll have to make sure that you stop at the shorter one.
	// (This is a great opportunity to review logical operators :) )
	//
	// So if you're given the code in main:
	//
	//	 	total = rh.compare(nums, moreNums);
	//		System.out.println("Exactly " + total + " values match");
	//
	//	Your method should return (and then have _main_ print) the '2'
	public int compare(??????)
	{
		
	}

	// **************************************************************************
	// Exercise #8:
	// For this exercise, you should implement a pair of methods: 
	// (A) compareMax
	// (B) resetCompareMax
	
	// METHOD: compareMax ////////////////////////////////////////////
	//
	// This method should take two parameters:
	// 1) An array that you want to compare to ...
	//	2) the other array.
	//
	// This method should take return one value:
	// 		The LARGER of 
	//				(1) The number of matching elements in the array
	//				(2) The largest number of matching elemnents, from 
	//					 all the previous comparisons you've done.
	//
	//	Note that the arrays might not be the same length,
	// so you'll have to make sure that you stop at the shorter one.
	public int compareMax(??????)
	{
		
	}
	
	// METHOD: resetCompareMax ////////////////////////////////////////
	// This resets the instance variable for compareMax, much like
	// resetSumMax resets the instance variable for sumMax
	public int resetCompareMax(??????)
	{
		
	}

	// EXAMPLE OUTPUT FOR EXERCISE #8:
	// So if you're given the code in main:
	//
	//	 	total = rh.compareMax(nums, moreNums);
	//		System.out.println("Exactly " + total + " values match"); // 2
	//		
	//	 	total = rh.compareMax(nums, yetMoreNums);
	//		System.out.println("Exactly " + total + " values match"); // 3
	//
	//	 	total = rh.compareMax(nums, moreNums);
	//		System.out.println("Exactly " + total + " values match"); // still 3
	//
	//		rh.resetCompareMax();
	//	 	total = rh.compareMax(nums, moreNums);
	//		System.out.println("Exactly " + total + " values match"); // back to 2	//
	//
	//	Your method should return (and then have _main_ print) the values
	// listed in the comment next to the line.
	
} // this is where the 'ReviewHelper' class ends

public class ArraysAndVariables extends Object
{
    public static void main(String[] args)
    {
	 	ReviewHelper rh = new ReviewHelper();
		
		int[] nums = new int[5];
		nums[0] = 3;
		nums[1] = 13;
		nums[2] = 5;
		nums[3] = 7;
		nums[4] = 2;
		
		// Ex #1
		rh.printArray(nums);
		
		// Ex #2
		rh.printPartOfArray(nums, 2);
		
		// Ex #3
		rh.printEveryOther(nums, true); // print out the even #'d spaces
		rh.printEveryOther(nums, false); // print out the odd #'d spaces
		
		// Ex #4
	 	int total = rh.sum(nums);
		System.out.println("total is: " + total);

		// Ex #5
		int[] moreNums = new int[4];
		moreNums[0] = 30;
		moreNums[1] = 30;
		moreNums[2] = 2;
		moreNums[3] = 3;
		
	 	total = rh.sumMax(nums);
		System.out.println("total is: " + total); // 30
	 	total = rh.sumMax(moreNums);
		System.out.println("total is: " + total); // 65
	 	total = rh.sumMax(nums);
		System.out.println("total is: " + total); // still 65
		
		// Ex #6
		rh.resetSumMax();	
	 	total = rh.sumMax(nums);
		System.out.println("total is: " + total); // once again 30

		// Ex #7
	 	total = rh.compare(nums, moreNums);
		System.out.println("Exactly " + total + " values match"); // 2 values

		// Ex #8:
		int[] yetMoreNums = new int[7];
		yetMoreNums[0] = 2;
		yetMoreNums[1] = 7;
		yetMoreNums[2] = 5;
		yetMoreNums[3] = 19;
		yetMoreNums[4] = 20;
		yetMoreNums[5] = 21;
		yetMoreNums[6] = 22;

	 	total = rh.compareMax(nums, moreNums);
		System.out.println("Exactly " + total + " values match"); // 2
		
	 	total = rh.compareMax(nums, yetMoreNums);
		System.out.println("Exactly " + total + " values match"); // 3

	 	total = rh.compareMax(nums, moreNums);
		System.out.println("Exactly " + total + " values match"); // still 3

		rh.resetCompareMax();
	 	total = rh.compareMax(nums, moreNums);
		System.out.println("Exactly " + total + " values match"); // back to 2
		
	}
}