private static GasTank getFromUserGasTankInfo(GasTank.eGasType i_GasType, float i_MaximalTankSize) { float currentAmountOfGas; Console.WriteLine("What is the current amount of gas in vehicle?"); currentAmountOfGas = getFromUserUnNegativeFloatLessThanMax(i_MaximalTankSize); return(new GasTank(currentAmountOfGas, i_MaximalTankSize, i_GasType)); }
private static GasTank.eGasType getFromUserGasType() { int userChoiceGasType; GasTank.eGasType gasType = GasTank.eGasType.None; Console.WriteLine("Please enter you wanted gas type from the following list:\n1.{0}\n2.{1}\n3.{2}\n4.{3}", GasTank.eGasType.Soler.ToString(), GasTank.eGasType.Octan95.ToString(), GasTank.eGasType.Octan96.ToString(), GasTank.eGasType.Octan98.ToString()); userChoiceGasType = getFromUerNumberInARange(1, 4); gasType = (GasTank.eGasType)userChoiceGasType; return(gasType); }