Assume that you have a variable twoD that refers to a two-dimensional array of integers. For example, here is one exampl

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Assume that you have a variable twoD that refers to a two-dimensional array of integers. For example, here is one exampl

Post by answerhappygod »

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.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply