Question: public class ArrayLab { public static void main(String[] args) { int[][] stuff = { {33, 92, 54}, {22, 43, 90}, {26, 85, 21}, {75, 14,
public class ArrayLab { public static void main(String[] args) { int[][] stuff = { {33, 92, 54}, {22, 43, 90}, {26, 85, 21}, {75, 14, 66}, { 8, 49, 89} }; // in all of the below 4 tasks, do not "hard code" the // array dimentions (i.e. "4" or "3") but rather use the // .length property of the array or individual row as // Horstmann does in the CompoundInterest program.
// 1. print out the array contents going across the rows // but from the last row to the first: // 8, 49, 89 // 75, 14, 66 // etc.....
// 2. print out the array contents going down the columns // from the first column to the last. in other words: // 33, 22, 26, 75, 8 // 92, 43, 85, 14, 49 // etc....
// 3. print out the array going up the columns, starting // with the last column and last row, and working backwards // to the first column and row. in other words: // 89, 66, 21, 90, 54 // 49, 14, 85, 43, 90 // etc....
// 4. print out the array contents in "normal" order, // in other words: // 33, 92, 54, // 22, 43, 90 // etc.... } }
follow instructions and add comments
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
