Question: this is the base to write the code for the parts Write a for-loop that traverses nums, removing every value that is divisible either by

this is the base to write the code for the parts Writea for-loop that traverses nums, removing every value that is divisible eitherby 3 or 4 . (Remember, a is divisible by b ifthis is the base to write the code for the parts

Write a for-loop that traverses nums, removing every value that is divisible either by 3 or 4 . (Remember, a is divisible by b if a%b==0 ) Afterwards, use the following instruction to verify that your code is correct: System.out.println( nums ); If correct, then the following numbers should be output when you print the ArrayList: [1,2,5,7,10,11,13] Afterwards, write a 2nd for-loop (continuing from where you left off in Part 1) that traverses the ArrayList. For each odd number it encounters, insert that value plus 30 after it (For example: If it encounters ' 3 ' at index 5 , then it should insert '33' at index 6). (Remember, a is odd if a%2==1 ) Print the ArrayList afterwards to verify that your code works. If done correctly, the following numbers should be output: [1,31,2,5,35,7,37,10,11,41,13,43]

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!