Capital One interview question

How would you program a coin calculator?