Beispiel #1
0
        private static void fuelGasolineVehicle()
        {
            string licensePlateNumber   = Utils.GetLicensePlateNumber();
            string gasolineType         = GetGasolineType();
            string gasolineAmountString = Utils.GetGasolineAmountToAdd();
            float  gasolineAmount;

            if (!float.TryParse(gasolineAmountString, out gasolineAmount))
            {
                throw new FormatException("Expected a float type value for Gasoline amount.");
            }

            m_Garage.FuelGasolineVehicle(licensePlateNumber, gasolineType, gasolineAmount);
            Console.WriteLine("The Vehicle's Gasoline Tank was successfully added with {0} Liters.", gasolineAmount);
        }