Repetition Patterns -- Practice public class Coin // class has no modifier methods (is "immutable") { public Coin(double aValue, String aName) { . . . } public double getValue() { . . . } . . . } public class CoinArray { private Coin[] A; // internal representation is an array /** Constructs an array of coins. **/ CoinArray(Coin[] inputArray) { // Code to construct and initialize A from inputArray is missing! } /** Sums the values in the array. **/ public double sum() { // Code to calculate the sum of the coin values in A is missing! } /** Determines whether a given value is in the array. * @return true if val is in the array; false otherwise **/ public boolean contains(double coinValue) { // Code to determine whether there is a coin with the // specified value in array A. } /** Finds the maximum coin value in the array. **/ public double maxValue() { // Code to find maximum value in the array is missing! } } public class CoinCollection { private ArrayList aList; // internal representation is an ArrayList /** Constructs an empty coin collection. **/ CoinCollection() { // Code to construct empty collection is missing! } /** Adds a coin to the collection. **/ void add(Coin coin) { // Code to add a coin to the collection is missing! } /** Sums the values in the collection. **/ public double sum() { // Code to calculate the sum of the coin values in aList is missing! } /** Determines whether a given value is in the array. * @return true if val is in the array; false otherwise **/ public boolean contains(double coinValue) { // Code to determine whether there is a coin with the // specified value in the collection. } /** Finds the maximum coin value in the array. **/ public double maxValue() { // Code to find maximum value in the collection is missing! } }