Question: Help with C++ Strict Arrays . Need help to build this program Inventory Struct Array Lookup for Purchases Create the console program described in a

Help with C++ Strict Arrays . Need help to build this program  Help with C++ Strict Arrays . Need help to build this
program Inventory Struct Array Lookup for Purchases Create the console program described
in a suitable folder. Name the Project Assign01-InventoryStruct Copy the two input
data files -Inventory.txt and Purchases.txt to the project folder for processing array

Inventory Struct Array Lookup for Purchases Create the console program described in a suitable folder. Name the Project Assign01-InventoryStruct Copy the two input data files -Inventory.txt and Purchases.txt to the project folder for processing array of record structs to hold the four inventory file values used to lookup data and process each purchase Suggested variables and declarations: #include #include #include #include using namespace std; struct Inventory.txt- Notepad Phoenix Juicer AX205 114.95 18 BL114 149.95 42 Harper_ Sound Monitor BY684 469.95 8 CL120 27.49 345 CL455 69.95 201 DD889 14.25 893 DQ114 18.49 81 Lerner Multi-Tiner EG802 34.95 22 Zygran Humidifier FA105 7.95 137 olden Video Splitter FZ225 12.49 73 Yard-eze CarryAll Feld Convection Oven Holden DoorGuard Entrex Static Hat Evans FloorCote inventoryType string itemCode; double itemPrice; int string itemName; itemOnHand; inventoryType void inventoryLookup(inventoryType inv[], int cnt, string code, int qty); inventoryReport(inventoryType inv[]. int cnt); int main() inventoryType inventoryRec[20]; array of Inventory records 361 0114 inventoryType inventoryMatch; CL120 FA105 FZ225 BY684 BL114 215 12 21 1 362 / matched Inventory record itemCount purcha secount purchaseAmount; // count of Inventory records364 // count of Purchases records 365 6; calculated amount total int char dollarsign ='5; string purchaseNum; string purchaseItem; int E6882 16 367 368 369 //Purchases file field values DQ114 18 purchasety; 371 372 D0559 325 CL455 78 Inventory input file Purchases input file AX205 ifstream inventoryFile; ifstream purchasesFile; 374 375 FA105 43 BY6842 Open the two input files and test both input streams. Issue an error message 6 3 and return -I to exit the main routine if either input file open attempt fails.377 09 208 74 Load each of four data items in an inventory record into an Inventory that forms a single entry in an array of structs (inventory ReelI). Count the 38 number of items loaded into this array and save this value (itemCount) in record 378 FA185 order to control loops that will process and search the array in called routines (inventory LookupO) and inventory ReportO)). Close the Inventory input file. Display the count of inventory records (itemCount). Set up a while loop to process each record until end-of file. Read the first purchase record into three variables. (Suggestion: Use a priming read to input the first field of the first record into the purchaseNum field on the line before the start of the while loop. Stream the other two purchases record fields into the purchaseltem and purchaseOty fields at Within the while loop (after reading each entire purchase record) . Lookup and return a matched Inventory record (inventoryMatch) based on the matching 2. Calculate total purchase amount for each purchase, multiplying matched item price bypurchase quan the top of the loop. Repeat priming read at the very bottom of loop.) input itemCode Display complete Purchase information in a stream to cout, including matched invent 4. Increment the purchase count variable to track the number of Purchase records

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!