1. prepare SQL statment to fetch all rows that A) match the customer number the user has entered and B)have transtype 'P'. 2. execute SQL statement 3. while (there's another row in the set) { print out the data }