The first thing you should do, is forget code, and think about the logic.
1. Enter a loop (I guess you'll be inputting more than 1 product by this statement)
2. Ask for the product name. Once it's given, store it, as you were instructed to.
3. Ask for a quantity. Once it's given, store it how you were instructed to, (probably the hash linking the name, to the quantity, not sure what use the array is personally).
Return to 1 for another product.
Once you have the logic figured out, the code is trivial.