示例#1
0
        private static string[] getTireManufacturers(VehicleTypes.eVehicleType i_VehicleType)
        {
            int tiresAmount = VehicleTypes.DefineTireAmountByType(i_VehicleType);

            string[] manufacturers = new string[tiresAmount];
            string   output        = string.Format("Enter the Manufacturers of All {0} Tires: ", tiresAmount);

            Console.WriteLine(output);

            for (int i = 0; i < tiresAmount; i++)
            {
                manufacturers[i] = Console.ReadLine();
            }

            return(manufacturers);
        }
示例#2
0
        private static float[] getCurrentPressureOfAllTires(VehicleTypes.eVehicleType i_VehicleType)
        {
            int tiresAmount = VehicleTypes.DefineTireAmountByType(i_VehicleType);

            float[] allTiresPressure = new float[tiresAmount];
            string  output           = string.Format("Enter the Air Pressure of All {0} Tires: ", tiresAmount);

            Console.WriteLine(output);

            for (int i = 0; i < tiresAmount; i++)
            {
                while (!float.TryParse(Console.ReadLine(), out allTiresPressure[i]))
                {
                    output = string.Format("Error,try again: ");
                    Console.WriteLine(output);
                }
            }

            return(allTiresPressure);
        }