Bin Manager Class
Design and write an object-oriented program for managing inventory bins in a warehouse. To do this you will use two classes: InvBin and BinManager. The InvBin class holds information about a single bin. The BinManager class will own and manage an array of InvBin objects. Here is a skeleton of what the InvBin and BinManager class declarations should look like:
class InvBin
{
private:
string description; // Item name
int qty; // Quantity of items
// in this bin
public:
InvBin (string d = "empty", int q = 0) // 2-parameter constructor
{ description = d; qty = q; } // with default values
// It will also have the following public member functions. They
// will be used by the BinManager class, not the client program.
void setDescription(string d)
string getDescription()
void setQty(int q)
int getQty( )
};
class BinManager
{
private:
InvBin bin[30]; // Array of InvBin objects
int numBins; // Number of bins
// currently in use
public:
BinManager() // Default constructor
{ numBins = 0; }
BinManager(int size, string d[], int q[]) // 3-parameter constructor
{ // Receives number of bins in use and parallel arrays of item names
// and quantities. Uses this info. to store values in the elements
// of the bin array. Remember, these elements are InvBin objects.
}
// The class will also have the following public member functions:
string getDescription(int index) // Returns name of one item
int getQuantity(int index) // Returns qty of one item
bool addParts(int binIndex, int q) // These return true if the
bool removeParts(int binIndex, int q) // action was done and false
// if it could not be done—
// see validation information
};
Client Program
Once you have created these two classes, write a menu-driven client program that uses a BinManager object to manage its warehouse bins. It should initialize it to use 9 of the bins, holding the following item descriptions and quantities. The bin index where the item will be stored is also show here.
1. regular pliers 25 2. n. nose pliers 5 3. screwdriver 25
4. p. head screw driver 6 5. wrench-large 7 6. wrench-small 18
7. drill 51 8. cordless drill 16 9. hand saw 12
The modular client program should have functions to display a menu, get and validate the user’s choice, and carry out the necessary activities to handle that choice. This includes adding items to a bin, removing items from a bin, and displaying a report of all bins. Think about what calls the displayReport client function will need to make to the BinManager object to create this report. When the user chooses the “Quit” option from the menu, the program should call its displayReport function one last time to display the final bin information. All I/O should be done in the client class. The BinManager class only accepts information, keeps the array of InvBin objects up to date, and returns information to the client program.
Input Validation in the BinManager class: The class functions should not accept numbers less than 1 for the number of parts being added or removed from a bin. They should also not allow the user to remove more items from a bin than it currently holds.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.