Question
Modified Bin Manager Class Modify the BinManager class you wrote for Programming Challenge 14 in Chapter 8 to overload its getQuantity, addParts, and removeParts functions
Modified Bin Manager Class Modify the BinManager class you wrote for Programming Challenge 14 in Chapter 8 to overload its getQuantity, addParts, and removeParts functions as shown here:
These new functions allow parts to be added, parts to be removed, and the quantity in stock for a particular item to be retrieved by using an item description, rather than a bin number, as an argument. In addition to writing the three overloaded functions, you will need to create a private BinManager class function that uses the item description as a search key to locate the index of the desired bin.
Test the new class functions with the same client program you wrote for Programming Challenge 14 in Chapter 8, modifying it to call the new functions. Be sure to use some descriptions that match bins in the array and some that do not.
As you did in the previous Bin Manager program, if an add or remove operation is successfully carried out, make the function return true. If it cannot be donefor example, because the string passed to it does not match any item description in the arraymake the function return false. If the getQuantity function cannot locate any item whose description matches the one passed to it, make it return 1.
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