```
int  CRuleSchemaEMI::Calculate(
	stRuleHandlerInput   objRuleHandlerInput,
	stRuleHandlerOutput & objRuleHandlerOutput)
{


	objRuleHandlerOutput.m_iRuleProcessingState = RULE_PROCESSING_STATE_COMPLETED_FAILURE;

	CString csLog;
	if (!IsRuleProcessingAllowedForCard(objRuleHandlerInput))
	{
		csLog.Format("IsRuleProcessingAllowedForCard false");
		CServerParams::LOGMessage(objRuleHandlerInput.llClientId, "CRuleSchemaEMI::Calculate", (unsigned char*)csLog.GetBuffer(), csLog.GetLength(), DelegateUtils::LOG_INFORMATION);
		return RULE_PROCESSING_NOT_ALLOWED_FOR_CARD;
	}

	CString csFormula = "";
	CString csTemp = "";
	shared_ptr<CInstantEMIParameters> pInstantEMIParameters = NULL;

	int iTenureID = 0;

	if (objRuleHandlerInput.bIsTenureSelected)
	{
		iTenureID = objRuleHandlerInput.iEMITenureID;
		if (m_bIsFixedEmiEnable && (0 == iTenureID))
		{
			iTenureID = objRuleHandlerInput.m_objFixedEMIDetail.iTenureID;
		}

		if (0 == iTenureID)
		{
			//NO EMI
			csLog.Format("NO EMI TENURE PRESENT!!");
			CServerParams::LOGMessage(objRuleHandlerInput.llClientId, "CRuleSchemaEMI::Calculate", (unsigned char*)csLog.GetBuffer(), csLog.GetLength(), DelegateUtils::LOG_INFORMATION);
			return RULE_PROCESSING_EMI_NOT_SELECTED;
		}
	}
	/**************************************************************************
	STEPS:
	1.If EMI Tenure is not selected get EMI Tenure selected from User.
	2.If EMI tenure is available get EMI Tenure parameters.
	3.Based on EMI Cashback Type calculate either Discount/Cashback.
	******************** Provide your response in exactly 5 paragraphs (separated nearby paragraphs with 3 aterisk symbols ***).
user