Question: write a java code: Categories Create a 2 - dimensional array of length 1 0 0 and fill the first row with the numbers 1

write a java code:
Categories
Create a 2-dimensional array of length 100 and fill the first row with the numbers 1-100. Create a method that takes in an int as a formal parameter and returns the appropriate int using the code below.
1.Number is prime
2.Number is divisible by 2 but not 3
3.Number is divisible by 3 but not 2
4.Number is divisible by both 2 and 3
5.Number is none of the above (example 25 is not prime, even, or divisible by 3)
Now use this method to fill the second row of the array.
Lastly, print the array in a vertical format with row 1 in the first column and row 2 next to it. The output should look something like this.
15
22
33
42
51
64
71
82
 write a java code: Categories Create a 2-dimensional array of length

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!