Question: Can someone help me with this lab? //(c) A+ Computer Science //www.apluscompsci.com //Name - import java.util.Scanner; import java.util.List; import java.util.Arrays; import java.util.ArrayList; import java.util.Collections; import

Can someone help me with this lab?

Can someone help me with this lab? //(c) A+ Computer Science //www.apluscompsci.com

//(c) A+ Computer Science //www.apluscompsci.com //Name - import java.util.Scanner; import java.util.List; import java.util.Arrays; import java.util.ArrayList; import java.util.Collections; import static java.lang.System.*; public class ArrayListFunHouseRunner { public static void main( String args[] ) { System.out.println(ArrayListFunHouse.getListOfFactors(9)); System.out.println(ArrayListFunHouse.getListOfFactors(23)); System.out.println(ArrayListFunHouse.getListOfFactors(50)); System.out.println(ArrayListFunHouse.getListOfFactors(100)); System.out.println(ArrayListFunHouse.getListOfFactors(762)); Integer[] nums = {2,6,8,9,10,12,13,15,17,24,55,66,78,77,79}; List list = new ArrayList( Arrays.asList(nums) ); System.out.println( list ); ArrayListFunHouse.keepOnlyCompositeNumbers( list ); System.out.println( list ); } }

//(c) A+ Computer Science //www.apluscompsci.com //Name - 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 getListOfFactors(int number) { return null; } public static void keepOnlyCompositeNumbers( List nums ) { } }

A+ Computer Science FACTORS 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 2 method that will remove all numbers from its ArrayList 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 classrrayLi strunitouse public static Arrayist getListotFactors (int umber) you will ad code public static void keepnlyCompositeKumbers List integer> nums) /yau will add code Files Needed Sample Data ArrayListFunHouse.java ArrayistFunHouseRunner.java 23 50 100 762 2 6 B 9 10 12 13 15 17 24 55 66 7B 77 79 Sample Output: t31 Il [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, 79 Compasite List 6, 8, 9, 10, 12, 15, 24, 55, 66, 78, 771

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!