/* As needed students can write additional methods and add attributes */ public class Biosphere { //Constant declarations and attributes by James Tam, don't change. public static final int ROWS = 10; public static final int COLUMNS = 10; public static final String HORIZONTAL_LINE = " - - - - - - - - - -"; public static final String HORIZONTAL_COUNT = " 0 1 2 3 4 5 6 7 8 9 "; private Critter [][] current; //Original code written by James Tam, don't modify public Biosphere(Critter [][] aWorld) { //Original code current = aWorld; //Student code } //The code used by the student was based on the display code written by James Tam public void display() { //Original code below: student can freely modify to fulfill assignment requirements //(add, delete, change existing code). int i; int r; int c; System.out.println(" PREVIOUS GENERATION"); System.out.println(HORIZONTAL_COUNT); System.out.print(" "); for (i = 0; i < ROWS; i++) System.out.print(" -"); //Line of dashes before the array System.out.println(); for (r = 0; r < ROWS; r++) { System.out.print(r); //Line # before each row for (c = 0; c < COLUMNS; c++) { System.out.print("|" + current[r][c]); //Bounding line left of array element } System.out.println("|"); //Bounding line at the of the row for the last element System.out.print(" "); for (i = 0; i < ROWS; i++) System.out.print(" -"); //Bounding line below each array element System.out.println(); } } //Original code written by James Tam, don't modify public Critter [][] getCurrent() { return(current); } //Original code written by James Tam public void runTurn() { //Original code below: student can freely modify to fulfill assignment requirements //(add, delete, change existing code). display(); } }