9A
Complete the NumberArray class. NumberArray encapsulates an int array. It has a constructor that takes an int array as a parameter. It has these methods to manipulate the array:
public int getLast() returns the last element in the arraypublic void swap(int index1, int index2) swaps the element at index1 with the element at index2 Nothing changes if either index is out of boundspublic boolean contains(int target) determines if a given element is in the array returning true if the element is in the array, otherwise falsepublic int product() gets the product of the elements in the array. It would probably be easiest to initialize product to 1. [Note: product means multiply]public String toString() gets a string representation of the array. (provided for you)Provide Javadoc
For the draft, provide the implementation of the constructor and the getLast() method. Implement the other methods as stubs. A stub for a method with return type of boolean returns false. Provide all the Javadoc
9B
Write a class TwoDUtil. TwoDUtil encapsulates a 2d array of Strings. It has a constructor which takes a 2d array of strings as a parameter.
It has these methods:
public String shortest() gets the shortest String in the 2d array. If more than one is shortest, return the firstpublic String lastColumn() gets a string with all the words in the last column separated by an asterisk * (no space). Don't put an * after the final elementpublic int howMany(char letter) Gets how many times a character appears in the array. It is case insensitive "B" and "b" are counted as the same letterNo starter file.
Provide Javadoc
For the draft, provide the constructor and initialize the instance variables. Implement the methods as stubs. Provide Javadoc
9C
For this problem you will create a crude relief map. A relief map is a map indicating hills and valleys by the use of different colors.
Our map will represent a square area 150 miles on a side. We will assume the elevation is the same in each 10 square mile area.
The Relief Map class has a constructor that takes a 15 X 15 2d array of integers. Each element in the array represents the average elevation in an area 10 miles on a side.
Relief Map has these methods:
public void drawMap() creates a map consisting of 15 X 15 colored squares with the upper left hand corner at (0, 0). The squares are 10 px X 10 px. The color of the square is determined as follows. Draw the rows and then the columns
public int maxDifference() gets the difference between the highest and lowest points in the map as a positive number. The map will look like this

For the draft, implement maxDifference()