Question: For this assignment, you are provided with a text file that contains a number which represents the number of items in the list, followed by
For this assignment, you are provided with a text file that contains a number which represents the number of items in the list, followed by the item name, followed by the quantity of that item. It repeats name and quantity information for the remaining items in the list.
Link to inventorytxt downarrow
You need to write a program that reads the contents of the file and stores them into two arrays; one for names and the other for quantities. Then you will display the following menu:
S search for item by name
U update item quantity
Q quit program
The S option, will ask the user for an item name and will display the quantity in inventory for that item.
The U option will ask the user for an item name, then it will ask the user for the new quantity and update the quantity in the array.
Once the user quits the program, you will then save the items and quantities back into the same file. It must be in the same format as the original file, ie number of items, then on a separate line the first item name, then below that line the quantity. Repeat item name and quantity until the end of the array has been reached.
Submit your cpp file. I will use my own inventory file with different values, but same format to test your code.
C
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
