Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 13 20 pts 71 returns true Ir this product is in stock. Otherwise returns false public boolean is Instock() (implementation not shown) 1 return
Question 13 20 pts 71 returns true Ir this product is in stock. Otherwise returns false public boolean is Instock() (implementation not shown) 1 return a string representation of this product public String tostring() { implementation not shown 2 end class Product Given the information of class Product and class InventoryManager, complete method getProduct ToRestock() of class InventoryManager. This method should scan all products in data member inventory and identify out-of-stock products. This method should return the IDs of those products in an ArrayList object and not generate any prints. For example, if there are 150 products in inventory and 20 of those are out of stock, this method should return the IDs of those 20 products in an ArrayList object. If all products are in stock, this method should return an empty ArrayList object. Please follow comments in the given code. Assume those methods marked with "implementation not shown" are ready for use. 11 This class manages an inventory of products public class Inventory Manager { // there may be instance variables, constructors, and methods that are not shown private ArrayList inventory; 1 represent product type store may carry public class Product 11 there may be instance variables, constructors, and methods that are not shown public Inventory Manager() { inventory = loadData(); // inventory now stores a list of products, each with ID and in-stock information } 11 returns the ID of this product public Strine setId() / Implementation not shown) returns true it this product is in stock, otherwise return false public boolean is Instock() { implementation not shown) public ArrayList get ProductsToRestock() { // ADD CODE > premera OTOL SHOW are ready TUTUS represent product type a store my carry public class Product 1 there may be instance variables, constructors, and methods that are not shown // returns the ID of this product public Stringt setid() { /* implementation not shown) // Loads product data from the back-end database and returns the 1 data in an ArrayList loadData() { /* implementation not shown > Il returns true if this product is in stock. Otherwise returns false public boolean isInStock() { /* implementation not shown */ } 1/ return a String representation of this product public String toString() { /* implementation not shown */ } // end class Product > 1/ end class Inventory Manager // This class manages an inventory of products public class Inventory Manager // there may be instance variables, constructors, and methods that are not shown private ArrayList inventory public InventoryManager() { inventory - loadData(); // inventory now stores a list of products, each with ID and in-stock information a 2 Information public ArrayList get ProductsToRestock() // ADD CODE > 1 Loads product data from the back-end database and returns the // data in an ArrayList
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