Determining quality based on price and cost