variable cash register calculation at the supermarket