Question: Exercise 4 . 5 8 Implement the number Instock method. This should locate a product in the collection with a matching ID and return the
Exercise Implement the number Instock method. This should locate
a product in the collection with a matching ID and return the current
quantity of that product as a method result. If no product with a matching
ID is found, return zero. This is relatively simple to implement once the
findProduct method has been completed. For instance, number Instock
can call the findProduct method to do the searching and then call the
getQuantity method on the result. Take care with products that cannot be
found, though.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
