Beispiel #1
0
        static void Main()
        {
            TransportCompany taxiCompany    = new TaxiTransCom("зеленоглазое такси");
            TransportService companyService = taxiCompany.Create("Такси", 2);

            double distance = 13.5;

            printInfo(companyService, distance);

            TransportCompany shippingCompany = new ShipTransCom("доставочка");

            companyService = shippingCompany.Create("Тяжкий груз", 3);

            distance = 135.7;
            printInfo(companyService, distance);

            TransportCompany drunkDriverCompany = new DrunkTransCom("Пьяный водитель");

            companyService = drunkDriverCompany.Create("Стакановец", 25);

            distance = 135.7;
            printInfo(companyService, distance);

            Console.ReadLine();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            TransportCompany trCom       = new TaxiTransCom("Служба такси");
            TransportService compService = trCom.Create("Такси", 1);
            double           dist        = 15.5;

            Print(compService, dist);

            TransportCompany gCom = new ShipTransCom("Служба перевозок");

            compService = gCom.Create("Грузоперевозки", 2);
            double distg = 150.5;

            Print(compService, distg);
            Console.ReadKey();

            TransportCompany DTC = new DrunkTransCom("Приехать забрать");

            compService = DTC.Create("Пьяный водитель", 4);
            double distance = 75;

            Print(compService, distance);
            Console.ReadKey();
        }