예제 #1
0
        private static void SetParamsAndGetCarCustomResult()
        {
            Console.WriteLine($"\n\nEnter the fuel type: ");
            ShowFuelTypes();
            var fuelType = Parsing.ParseFuelType();

            if (fuelType == FuelType.Electric)
            {
                var carEnginePower    = Parsing.ParseInt("engine power in KW");
                var electricCarResult = CustomService.GetCarCustomValue(fuelType, carEnginePower);
                Console.WriteLine($"Full payment : {electricCarResult} EUR.");
            }
            else
            {
                var carPrice        = Parsing.ParsePrice("price");
                var carYear         = Parsing.ParseDateTime("year");
                var carEngineVolume = Parsing.ParseInt("engine volume in cubic centimeters");

                var carResult = CustomService.GetCarCustomValue(fuelType, carEngineVolume, carPrice, carYear);
                Console.WriteLine($"Full payment : {carResult} EUR.");
            }
        }