# Welcome to Computer Programming

 HWJ13_2D Arrays Start with the file below and use it to create the 5 methods described. Advanced people MUST do at least 2 of the advanced. ``````/** * Practice with 2 dimensional arrays * * @author (your name) * @version (a version number or a date) */ public class HWJ13_2DArrays { static int table[][]=new int; //the constructor fills in the 2d array with some values below: public static void setup2DArray() { table=6; table=4; table=0; table=19; table=13; table=53; table=44; table=51; table=27; table=30; table=31; table=30; table=24; table=40; table=10; } //have it print out the array in a nice fashion public static void printArray() { setup2DArray(); //keep this line - sets up the array //put code below } //replace every element with a random value public static void fillWithRandom() { setup2DArray(); //keep this line - sets up the array //put code below } //have it add x to every element in the table public static void addToEach(int x) { setup2DArray(); //keep this line - sets up the array //put code below } public static int findMaxValue() { setup2DArray(); //keep this line - sets up the array //put code below return 0; } public static double findAvgValue() { setup2DArray(); //keep this line - sets up the array //put code below return 0; } //ADVANCED //find the sum of whatever row they put in (assume row is between 0 and 4 if they put in 2 it would be 72) public static int findSumRow(int row) { setup2DArray(); //keep this line - sets up the array //put code below return 0; } //ADVANCED //find the sum of whatever column they put in (assume col is between 0 and 2 [so if they put in 2 it would be 130) public static int findSumCol(int col) { setup2DArray(); //keep this line - sets up the array //put code below return 0; } //ADVANCED - This method will add x to beginning of table, shifting all values over one (and losing the last value) public static void addToBeginning(int x) { setup2DArray(); //keep this line - sets up the array //put code below } //ADVANCED - This method will return the entire table as a 1d array public static int[] createSingleDimension() { setup2DArray(); //keep this line - sets up the array //put code below return null; } public static int findRandom (int min, int max) { int range=max-min+1; int rand=(int)(Math.random()*range)+min; return rand; } } ``````