Can't get this to work any help would be appreciated

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
};


Rest of the code:

#include <iostream>
#include <iomanip>
#include <windows.h>
#include <string>
#include <vector>

using namespace std;

// 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;}

BinManager::BinManager()
{ numBins = 0;}

BinManager::BinManager(int size, string d[ ], int q[ ])
{
int index;
cout<<"constructor"<<endl;
for( index=0 ; index < size ; index++ )
{
bin.push_back(InvBin(d[index],q[index]));
cout<<fixed<<left<<index +1<<" ";
cout<<setw(20)<<bin.end()->getDescription();
cout<<" "<<bin.end()->getQty()<<endl;
}
Sleep(2000);
}

// Member functions /////////////////////////////////////////
string InvBin::getDescription()
{
return description;
}

int InvBin::getQty( )
{
return qty;
}

string BinManager::DisplayAllBins()
{
int i;
cout<< "Current Inventory: "<<endl;
cout<<"still not working"<<endl;
for (i=0; i<bin.size();i++)
{
cout<<fixed<<left<<i<<" "<<setw(20);
cout<<bin[i].getDescription();
cout<<" "<<bin[i].getQty()<<endl;
}
Sleep(4000);
return 0 ;
};





Not sure what I'm doing wrong but any help will be appreciated. Thanks
Please format your code using code tags.

Please provide a description of what the program should be doing.

Please explain why you think the program is generating the wrong output.

You cannot expect someone to try do all that for you.
Topic archived. No new replies allowed.