Assume that you have a variable twoD that refers to a two-dimensional array of integers. For example, here is one exampl
Posted: Sun Jul 10, 2022 11:27 am
Assume that you have a variable twoD that refers to atwo-dimensional array of integers. For example, here is one exampleof such an array: int[][] twoD = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9,10, 11, 12}}; (1 point) Write an assignment statement that replacesthe value of 7 in the above array with a value of 15. (2 points)Write a code fragment that prints the values in the leftmost columnof the array to which twoD refers. Print each value on its ownline. For the array above, the following values would be printed: 15 9 Make your code general enough to work on any two-dimensionalarray named twoD that has at least one value in each row. You mayalso assume that the array to which twoD refers is not “ragged” —i.e.,
that all rows have the same number of elements. (2 points) Writea code fragment that prints the values in the bottom row of thearray to which twoD refers. Print each value on its own line. Forthe array above, the following values would be printed: 9 10 11 12Make your code general enough to work on any two-dimensional arraynamed twoD that has at least one row.
that all rows have the same number of elements. (2 points) Writea code fragment that prints the values in the bottom row of thearray to which twoD refers. Print each value on its own line. Forthe array above, the following values would be printed: 9 10 11 12Make your code general enough to work on any two-dimensional arraynamed twoD that has at least one row.