Question: Write code that creates a 3 row, 7 column int array whose values in each element are the product of the row and column indices
Write code that creates a 3 row, 7 column int array whose values in each element are the product of the row and column indices for that array. That is, the contents of the array should be: 0 0 0 0 0 0 0 0 1 2 3 4 5 6 0 2 4 6 8 10 12
You may not use the curly-brace syntax to manually type out and fill the above contents of the array.
After you create the array, write the code to change all the elements of the array so they are doubled three times. That is, after the three-fold doubling, the array will have the values: 0 0 0 0 0 0 0 0 8 16 24 32 40 48 0 16 32 48 64 80 96
You may not use the exponentiation operator nor more than a single multiplication symbol in this second portion. That is to say, you have to do this three-fold doubling via a loop. You do not need to provide infrastructure such as a class statement, a main method statement, etc.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
