text: public static double Calculate(double pStartDateVal, double pEndDateVal, int basis){if (basis < 0 || basis >= 5){throw new EvaluationException(ErrorEval.NUM_ERROR);}int startDateVal = (int)Math.Floor(pStartDateVal);int endDateVal = (int)Math.Floor(pEndDateVal);if (startDateVal == endDateVal){return 0;}if (startDateVal > endDateVal){int temp = startDateVal;startDateVal = endDateVal;endDateVal = temp;}switch (basis){case 0: return Basis0(startDateVal, endDateVal);case 1: return Basis1(startDateVal, endDateVal);case 2: return Basis2(startDateVal, endDateVal);case 3: return Basis3(startDateVal, endDateVal);case 4: return Basis4(startDateVal, endDateVal);}throw new InvalidOperationException("cannot happen");}