You may use the following function toread data for one inventory item:
void InventoryItem::read(ifstream&inFile)
{
string line;
getline(inFile, line, ‘,’);
setDescription(line);
int q; double p; char comma;
inFile >> q;
setQuantityOnHand(q);
inFile >> comma;
inFile >> p;
setPrice(p);
inFile.ignore(100, ‘n’);
}
Below is a UML class diagram of class InventoryItem:
InventoryItem
description: string
qantityOnHand: int
price: double
+ InventoryItem()
+ InventoryItem(string, int, double)
+ getDescription() const: string
+ getQuantityOnhand() const: int
+ getPrice() const : double
+ setDescription(string): void
+ setQuantityOnhand(int): void
+ setPrice(double): void
+ display() const: void
+ read(ifstream &): void
Task 1 Submission (50%):
1. Write a test program (i.e. function main() ) to read from thean input file any number
PayPal Gateway not configured
PayPal Gateway not configured