public decimal getTotalCost() { decimal totalCost = 0; int amount = _count; while (amount > 0) { if (_isOnPromotion && _promotionInfo.isMetPromoRequirements(amount)) { totalCost += _promotionInfo.getTotalPriceForQuantityMet(); amount -= _promotionInfo.getQuantityToGetPromoPrice(); } else { totalCost += _regularPrice; amount -= 1; } } return(totalCost); }