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

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.
Number is prime
Number is divisible by 2 but not 3
Number is divisible by 3 but not 2
Number is divisible by both 2 and 3
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.
\table[[1,5],[2,2],[3,3],[4,2],[5,1],[6,4],[7,1],[8,2]]
 Categories Create a 2-dimensional array of length 100 and fill the

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!