public override string CalculateIterest(decimal numberOfMonths) { if (Coustomer.GetType().Name.CompareTo("Individual") == 0) { if (numberOfMonths <= 3) { return("Individuals have no interest for the first 3 months! "); } return(((numberOfMonths - 3) * (this.InterestRate / 100)).ToString()); } else { if (numberOfMonths <= 2) { return("Companies have no interest for the first 2 months! "); } return(((numberOfMonths - 2) * this.InterestRate).ToString()); } }
public override string CalculateIterest(decimal numberOfMonths) { if (Coustomer.GetType().Name.CompareTo("Individual") == 0) { if (numberOfMonths <= 6) { return("Individuals have no interest for the first 6 months! "); } return(((numberOfMonths - 6) * this.InterestRate).ToString()); } else { if (numberOfMonths <= 12) { return((numberOfMonths * (this.InterestRate * 0.5M)).ToString()); } return((12 * ((this.InterestRate / 100) * 0.5M)) + ((numberOfMonths - 12) * (this.InterestRate / 100)).ToString()); } }