if(readLoyalC.is_open() && readCart.is_open())
{
/********** Populate the Customer Database*******************/
//read the first record and the database
readLoyalC>>lNo;
readLoyalC>>llname;
readLoyalC>>lfname;
readLoyalC>>lPts;
//initialise with data from file
toCheck = RetailItem(inNo, inDes, iCost, iQty);
// add to database
teller.addRetailItem(toCheck, iQty);
} //end of populating the cash register
/*calulate the values for the bill*/
subTo = teller.getSubTotal();
eTax = teller.getTax();
tCost = teller.getTotal();
/** formulate bill and print **/
cout<<"Please enter the shopper's Loyalty Card Number: ";
cin>>uNO;
/* print bill header */
cout<<endl<<billHeader;
if (loyalDatabase.setverifyAc())
{
LoyaltyAccount customer = loyalDatabase.setallInfo();
cout<<customer.getlastName()<<"\t"<<customer.getfirstName();
cout<<endl<<customer.getaccountNum()<<endl;
cout<<"Current Year Balance Points: "<<customer.gettotalPoints();
}
else
{
cout<<"Please apply instore of a Shopper's Card"<<endl;
/*print listing for the bill*/
cout<<"--------------------------------------------------------"<<endl;
teller.retItemObj[10];
cout<<"--------------------------------------------------------"<<endl;
/* print values on the bill */
cout<<"Taxable Sales\t\t"<<subTo;
cout<<"VAT on Sales\t\t"<<eTax;
cout<<"TOTAL SALES\t\t"<<tCost;
} // end of file opened succesfully
else
{
cout<<endl<<"Files could not be opened. APPLICATION TERMINATING";
return -1;
}
//cal the total
return 0;
}//end main
i wrote this code to display a shop
am getting error
error no matching function for call 'RetailItem::RetailItem()
so can any one example or help with the error
You probably declared a constructor for RetailItem with some arguments. If you did that, the default constructor (RetailItem::RetailItem()) is not automatically created. Your first line on main creates a RetailItem calling its constructor with no arguments.