Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please complete the code in java Labwork 2D arrays allow us to contain and organize data, while easily being able to find and change the

please complete the code in java

image text in transcribed

image text in transcribed

Labwork 2D arrays allow us to contain and organize data, while easily being able to find and change the information within it. Instructions: Download Lab Work 8.2 from Mimir. Take in one line of input. This line takes in an integer that you will be using to start your matrix. Save it in startVal. Create an empty 5 by 5 2D. Iterate through each element and add a value starting from startVal and incrementing by 4 each time. o If the incremented value is divisible by 3, set that element to 0. o For example, if startVal = 5, then the created 2D array would be: [[5, 0, 13, 17, 0], [25, 29, 0, 37, 41], [0, 49, 53, 0, 61], [65, 0, 73, 77, 0], [85, 89, 0, 97, 101]] Finally, print the created array in reverse with a space after each value and a new line after each row. o Per the previous example, the output would be: 101 97 0 89 85 0 77 73 0 65 61 0 53 490 41 37 0 29 25 0 17 13 0 5 class lab8_2 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("What number would you like to start your matrix with?"); int startVal;| } //end main } //end class

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases New Opportunities For Connected Data

Authors: Ian Robinson, Jim Webber, Emil Eifrem

2nd Edition

1491930896, 978-1491930892

More Books

Students also viewed these Databases questions

Question

Explain Coulomb's law with an example

Answered: 1 week ago

Question

What is operating system?

Answered: 1 week ago

Question

What is Ohm's law and also tell about Snell's law?

Answered: 1 week ago