Trying to get this to display the correct output but still having some problems.
Here is what I have so far:
Header file:
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
};
// Class declarations ////////////////////////////////////////////////////
class InvBin
{
string description;
string numBins;
int qty;
public:
InvBin(string, int);
string getDescription();
int getQty();
};
class BinManager
{
int numBins; // Not really required anymore, use bin.size() instead.
vector<InvBin> bin;
public:
BinManager(int, string d[], int q[]);
BinManager();
string DisplayAllBins();
};
// Constructors ///////////////////////////////////////////////
InvBin::InvBin (string d = "empty", int q = 0)
{description = d; qty = q;}