Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PLEASE fill in all the todo lines based on inventory assignment. and I have uploaded the methods that can be used if needed. Thank you
PLEASE fill in all the todo lines based on "inventory" assignment. and I have uploaded the methods that can be used if needed.
Thank you
public class Inventory public class Inventory . 1 public class Inventory 2 // TODO :Add an Item[] instance variable called contents. // Initialize it at declaration; give it a default length of 4. 4 // Merge two inventorys, merging other into this inventory. public void merge(Inventory other) t 7 // TODO :Compute contents.length other.contents.length // TODO :Create a new Item[] of the size above // TODO Copy all the elements from contents into the new Item [ // TODO: Copy all the elements from other.contents into the new Item[l // TODO : Set contents to be the new Item[] we just filled 10 12 13 15 // Get the i-th item, where the 0th item is the first. // Return null if the index is invalid. public Item getItem(int i)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started