calculates shopping amount and rate