Exemplo n.º 1
0
        public bool AddCar()
        {
            Console.WriteLine("Введите тип машины: BUS, MINIBUS, TRUCK.");
            string type = Console.ReadLine();

            if (type == "BUS")
            {
                Console.WriteLine("Введите расход, пассажироемкость и грузоподъемность.");
                return(factory.AddBus(Convert.ToDouble(Console.ReadLine()), Convert.ToInt32(Console.ReadLine()), Convert.ToDouble(Console.ReadLine())));
            }
            else if (type == "TRUCK")
            {
                Console.WriteLine("Введите расход и грузоподъемность.");
                return(factory.AddTruck(Convert.ToDouble(Console.ReadLine()), Convert.ToDouble(Console.ReadLine())));
            }
            else if (type == "MINIBUS")
            {
                Console.WriteLine("Введите расход и пассажироемкость.");
                return(factory.AddVan(Convert.ToDouble(Console.ReadLine()), Convert.ToInt32(Console.ReadLine())));
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 2
0
 public bool AddVan(double GasUse, int PassCapacity)
 {
     return(Enterprice.AddVan(GasUse, PassCapacity));
 }