/// <summary> /// All numbers up to and including the number entered, except when: /// A number is a multiple of 3 output C, and when, /// A number is a multiple of 5 output E, and when, /// A number is a multiple of both 3 and 5 output Z /// </summary> /// <param name="numbers">list of numbers</param> /// <returns>list of string</returns> private Dictionary <int, string> ReplaceNumberByLetterWhenMultiple(int number) { try { BusinessData PreLoadedData = BusinessData.Instance; return(PreLoadedData.GetAllReplacebleNumbers().Where(n => n.Key <= number).ToDictionary(x => x.Key, x => x.Value)); } catch (Exception ex) { throw ex; } }
/// <summary> /// All fibonacci number up to and including the number entered /// </summary> /// <param name="number">number</param> /// <returns>fibonacci list</returns> private int[] GetFibonacciNumbers(int number) { try { int[] fibList; BusinessData PreLoadedData = BusinessData.Instance; if (number == 0) { fibList = new int[] { } } ; else { fibList = PreLoadedData.GetAllFibonacci().Where(f => f < number && f <= int.MaxValue).Select(f => (int)f).ToArray(); } return(fibList); } catch (Exception ex) { throw ex; } }