/** Represents an array of integers each in the range -8..7. * Such integers may be represented in 4 bits (called nybbles). */ public class Nybbles { /** An array of size N. */ public Nybbles (int N) { // DON'T CHANGE THIS. data = new int[ (N+7) / 8 ]; this.N = N; } /** The size of THIS. */ public int size () { return N; } /** Return the Kth integer in THIS array, numbering from 0. * Assumes 0 <= K < N. */ public int get (int k) { if (k < 0 || k >= N) throw new IndexOutOfBoundsException (); else return /* REPLACE WITH ANSWER */ 0; } /** Set the Kth integer in THIS array to VAL. Assumes * 0 <= K < N and -8 <= VAL < 8. */ public void set (int k, int val) { if (k < 0 || k >= N) throw new IndexOutOfBoundsException (); else if (val < -8 || val >= 8) throw new IllegalArgumentException (); else data[ /* REPLACE WITH ANSWER */ 0 ] = /* REPLACE WITH ANSWER */ 0; } // DON'T CHANGE OR ADD TO THESE. private int N; private int[] data; }