1. Declare a structure named Inventory that is to be used to store records in the company’s file system. The field in the record should include itemNumber, itemName, itemCount, itemPrice. 2. Declare...

1. Declare a structure named Inventory that is to be used to store records in the company’s file system. The field in the record should include itemNumber, itemName, itemCount, itemPrice. 2. Declare an array of type Inventory of size 50 called myInventory, an instance of Inventory called newItem, and a double called total. 3. When the program starts, read the contents of the file inventory.txt in the array myInventory. 4. Write the following functions: • void readInData(Inventory[], int&) Accepts an array of Inventory items and a reference parameter of type int. The function should read the data from the file “Inventory.txt” and store it in the array. Should update the reference parameter of type int with the number of items read. • void createReport(Inventory[], int) accepts an array of Inventory items, and the number of array items to consider, and displays a report as follows: *******************************Inventory Report****************************** Item Number Item Name Item Count Item Price -------------------------------------------------------------------------------------------------------- 1092 Pencil 279 $2.20 1107 Marker 102 $2.70 1820 Eraser 145 $3.50 3526 Notebook 200 $1.75 Page 2 • Inventory getItem() should accept no parameters. The function should prompt the user for a new Inventory item and return it. Input Validation: Do not accept amounts less than 1 for item count or item price. • void addItemToFile(Inventory) accepts an Inventory item as a parameter and appends the file “Inventory.txt” with the passed Inventory item. • double totalCost(Inventory[], int) accepts an array of Inventory items and the number of items in to be considered. The function should calculate and return the total cost of all the items in the array. Grading Rubric: Struct definition 10 Array definition 10 Menu-Driven Interface 30
Apr 28, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here