1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
using namespace std;
#include <iostream>
#include <iomanip>
class InvBin
{
private:
string description;
int qty;
public:
InvBin (string d = "empty", int q = 0)
{ description = d; qty = q; }
void setDescription(string d)
{description =d;}
string getDescription()
{return description;}
void setQty(int q)
{qty =q;}
int getQty( )
{return qty;}
};
class BinManager
{
private:
InvBin bin[20];
int numBins;
public:
BinManager()
{ numBins = 0; }
BinManager(int size, string d[], int q[])
{
for( int count=0; count <size; count ++)
{
bin[count].setDescription(d[count]);
bin[count].setQty(q[count]);
}
}
string getDescription(int index)
{
return bin[index].getDescription();
}
int getQuantity(int index)
{
return bin[index].getQty();
}
string displayAllBins();
};
int main ()
{
string test;
string array_descript[20]{"thing1","thing2","thing3","thing4","thing5","thing6","thing7","thing8","thing9"};
int array_quantity[20]{2,53,5,36,6,1,1,7,2};
BinManager object1(9,array_descript,array_quantity);
test= object1.getDescription(9);
cout << test;
}
|