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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started