Exemplo n.º 1
0
        internal static string GetLampRow(int totalNumberLamps, int numberLampsOn, StatusLampEnum statusLamp)
        {
            StringBuilder result = new StringBuilder();

            result.Append(AddLampsOn(numberLampsOn, statusLamp));
            result.Append(AddLampsOff(numberLampsOn, totalNumberLamps));
            return(result.ToString());
        }
Exemplo n.º 2
0
        private static string AddLampsOn(int numberLampsOn, StatusLampEnum statusLamp)
        {
            StringBuilder result = new StringBuilder();

            for (int i = 0; i < numberLampsOn; i++) // For each lamp on, add this to result
            {
                result.Append(statusLamp.GetDescription());
            }
            return(result.ToString());
        }