matlab question?

Design an algorithm (i.e. write the structure plan) for a machine which must give the correct amount of change from a $100 note for any purchase costing less than $100. The plan must specify the number and type of all notes and coins in the change, and sholud in all cases give as few notes and coins as possible.( please someone can help. i don't know how to do it.)