Пример #1
0
        public static double TemperatureRequest(TypeOfTemperature typeOfTemperature)
        {
            double dbl;

            ShowMsg(typeOfTemperature);
            while (!double.TryParse(Console.ReadLine().Replace('.', ','), out dbl))
            {
                ShowMsg(typeOfTemperature, true);
            }
            return(dbl);
        }
Пример #2
0
        public static void ShowMsg(TypeOfTemperature typeOfTemperature, bool isRepeat = false)
        {
            StringBuilder builder = new StringBuilder("Please, enter ", 100);

            if (isRepeat)
            {
                builder.Append("correct ");
            }

            builder.Append($"{typeOfTemperature} temperature: ");

            Console.WriteLine(builder);
        }