Course Solutions Uncategorized (Solved) : May Use Following Function Read Data One Inventory Item Void Inventoryitem Read Ifstream I Q30110699 . . . .

(Solved) : May Use Following Function Read Data One Inventory Item Void Inventoryitem Read Ifstream I Q30110699 . . . .

 

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

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post