Question: Add comments in the program and follow instructions in the comments. Finally add comments with your name, date, description etc. at the top of the

Add comments in the program and follow instructions in the comments.

Finally add comments with your name, date, description etc. at the top of the file.

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 in "normal" order using for-each loops only, // in other words: // 33, 92, 54, // 22, 43, 90 // etc....

// 2. print out the array contents going down the columns // from the first column to the last using while loops only. 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 using for loops. in other words: // 89, 66, 21, 90, 54 // 49, 14, 85, 43, 90 // etc....

// 4. print out the array contents going across the rows // but from the last row to the first: // 8, 49, 89 // 75, 14, 66 // etc..... } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!