Question: Question 2(5 marks) The following is code for a ItemArrayList class that uses Item and ItemList (Pages 9-10) Answer this question as instructed in the
Question 2(5 marks) The following is code for a ItemArrayList class that uses Item and ItemList (Pages 9-10) Answer this question as instructed in the //TODO tag below. public class ItemArrayList implements ItemList { 0 private static final int INIT SZ = 2; // initial size of data private int count; // number of elements in this list private Item data; array to hold list elements /*TODO: This implementation of find has errors in it. Find and fix the errors by editing the code given. That is, cross out the wrong code and writing in code you want to add. D O NOT rewrite the whole function. Marks will be deducted for "fixing" code that is correct. */ BO /* Parameters: (Item) item Purpose: gets the position item is found in this list Returns: (int) position is found in the list, -1 if not found public static int find (Item item) for (int i = 0; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
