示例#1
0
        public float GetFuelValues(FuelAmount fuel)
        {
            float fuelingValue = 0f;

            if (fuel.ToString() == FuelAmount.Large.ToString())
            {
                fuelingValue = 55f;
            }
            if (fuel.ToString() == FuelAmount.Medium.ToString())
            {
                fuelingValue = 35f;
            }
            if (fuel.ToString() == FuelAmount.Small.ToString())
            {
                fuelingValue = 25f;
            }

            return(fuelingValue);
        }
示例#2
0
文件: Car.cs 项目: xmdn/shelter
 public void DisplayForCheckFuel()
 {
     Console.WriteLine($"{Model} {FuelAmount.ToString("0.00")} { DistanceTreveled}km");
 }
示例#3
0
文件: Car.cs 项目: xmdn/shelter
 public void Display()
 {
     Console.WriteLine($"{Model} {FuelAmount.ToString("0.00")} { DistanceTreveled}km {FuelConsumptionFor1km}");
 }