Alright well I have been trying for a while and have had no luck to be able to do this. I removed the unimportant code and left just what is needed. I'm just going to post the two classes because that's pretty much all that is involved in this.
So the problem is with the method getWholesale in the cPRODUCT class. I'm trying to get it to return the value into the cINVENTORY class and make it equal to the variable fWholesaleCost in the addProduct method (this is all where the ? are )
Code:
//Removed all the beginning code, end code and unimportant methods
class cPRODUCT
{
private:
long nSerialNum;
string ProductDesc;
float fWholesale;
float fRetailcost;
int nInStock;
public:
cPRODUCT(void)
{
nSerialNum = 0;
ProductDesc = "";
fWholesale = 0;
fRetailcost = 0;
nInStock = 0;
}
float getWholesale(void)
{
return fWholesale;
}
Code:
//Again, I removed the beginningcode, end code and other methods that weren't important
class cINVENTORY
{
private:
cPRODUCT Products[100];
short nNumProdTypes;
float fTotalWhole;
float fTotalRetail;
int nOverallItems;
public:
cINVENTORY(void)
{
Products[100];
nNumProdTypes = 0;
fTotalWhole = 0;
fTotalRetail = 0;
nOverallItems = 0;
}
void addProduct(void)
{
fWholesaleCost = ??????????.getWholesale();
}
If you guys need any more info, let me know...but I think this is pretty much it (the barebones).
Thanks for any help you can give...trying to get this part to work but it just isn't working out for me,
...Dan