Question: Lab Goal This lab was designed to introduce and demonstrate how to use an ArrayList. Lab Description: Create a method that will receive an integer



Lab Goal This lab was designed to introduce and demonstrate how to use an ArrayList. Lab Description: Create a method that will receive an integer parameter and then return an ArrayList that contains all of the number's factors, excluding 1 and itself. Create a 2ne method that will remove all numbers from its Aravlist parameter that are not composite numbers. Composite numbers are divisible by 1 itself, and must have at least 1 other positive factor. You will need to use % to determine if a number is a factor public class ArravListFunHouse public staticaintege> getliatofFastoraint numbe) you will add code public atatic void keepOasiteumbera Listsinteger> I you will add code Files Needed Sample Data ArrayListFunHouse.java ArrayListFunHouseRunner.java 100 762 2 68 9 10 12 13 15 17 24 55 66 78 77 79 Sample Output r 3] [2, 5, 10, 25] [2, 4, 5, 10, 20, 25, 501 2, 3, 6,127, 254, 381) Original List 2, 6, 8, 9, 10, 12, 13, 15, 17, 24, 55, 66, 78, 77, 791 Composite List , 8, 9, 10, 12, 15, 24, 55, 66, 78, 771 import java.util.Scanner; import java.util.List; import java.util.ArrayList; import java.util.collections; import static java.lang.System.*; public class ArrayListFunHouse public static ArrayList
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
