Sample code for a price calculator