I need help trying to figure out how to read in a [b]master inventory file [/b]that contains product ID number, short name with a maximum length of 20 characters, the cost of the product, a reorder level for the product and a reorder amount for the product. Then read in the inventory list that contains the product id and the amount in stock. then i need to compare the inventory lists amount in stock to the reorder level of the master inventory to see if anything new needs to be ordered. An example of both files will be provided below. im not asking for someone to write the code, im just asking if anyone can walk me through it.
First you would create a product class with a field for ID, name, etc. You also want to define a compare function based on product ID
Then, line by line, read from your master inventory file to create a product object and store that into a vector. Then use the built in sort to sort your vector.
For the inventory file, read in line by line again. For each line, find the object matching the ID and compare the reorder level of the object with the current amount.