Exemplo n.º 1
0
        /// <summary>
        /// Charges electric vehicle
        /// </summary>
        private void charge()
        {
            string licenseNumber = getLicenceNumberFromUser();
            float  chargeAmount  = getChargeAmountFromUser();

            Vehicle electricVehicle = null;

            if (m_Garage.GetElectricVehicles.TryGetValue(licenseNumber, out electricVehicle))
            {
                m_Garage.Charge(electricVehicle, chargeAmount);
            }
            else
            {
                write("No fuel vehicle listed for license number " + licenseNumber);
            }
        }