in reply to Re^2: seeking advice on loops
in thread seeking advice on loops

Ok, since you've said that the user input needs to happen repeatedly, that tells you that you want the user input to happen inside a loop. Since you've said that you want to keep looping *while* a certain condition isn't met (the user says 'no'), that tells you that you want a while loop.

Personally I like to use psuedo-code - something that is half-way between English (or whatever your native tongue) and code - and then gradually replace the pseudo-code with real code. Here's how I'd start with your assignment:

    user_wants_to_continue is 'yes'
    while ( user_wants_to_continue is not 'no' ) {
        prompt for and get product_name
        prompt for and get quantity
        prompt for and get price
        store product_name in array
        store product_name, quantity, price in hash
        prompt for and get user_wants_to_continue
     }