public static void Main() { _validator = new ConsoleInputValidator(); // Task B var sideLength = _validator.GetIntegerInput("Input square side length: ", 0, int.MaxValue); var square = new Square(sideLength); Console.WriteLine(square.ToString()); // Task C var name = _validator.GetStringInput("What is your name?"); var age = _validator.GetIntegerInput("How old are you?", 0, int.MaxValue); var person = new Person(name, age); Console.WriteLine(person.ToString()); // Task D var radius = _validator.GetDoubleInput("Input radius: ", 0, double.MaxValue); var circle = new Circle(radius); var sphere = new Sphere(radius); Console.WriteLine($"Area= {circle.Area} Volume= {sphere.Volume} "); Console.ReadKey(); }
public static void Main() { var manager = new WeatherManager(); manager.GetRandomWeather(12); _validator = new ConsoleInputValidator(); manager.PrintWeather(); var pressure = _validator.GetDoubleInput("Enter Pressure: (0-1000)", 0, 1000); manager.PrintWeatherWhenPressureLessThan(pressure); var avgTemp = manager.AverageTemperatureOfNonWindsDays(); Console.WriteLine($"Середня температура безвітряних днів = {avgTemp}"); var precipitationsCount = manager.CalculatePrecipitationsCount(); Console.WriteLine("Порахувати скiльки днiв падав дощ, снiг, а скiльки було без опадiв"); Console.WriteLine($"Rain: {precipitationsCount.rain} Snow: {precipitationsCount.snow} WithoutPrecipitation: {precipitationsCount.withoutPrecipitation}"); Console.WriteLine("Видрукувати прогнози погоди в порядку спадання температур"); var sortedWeather = manager.SortWeatherTemperatureDecrease(); manager.PrintWeather(sortedWeather); Console.ReadKey(); }