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(); }
static void Main(string[] args) { Transportation transport = new RoadTransportation(); TransportService transportService = new TransportService(transport); transportService.GetTransport(); transport = new SeaTransportation(); transportService = new TransportService(transport); transportService.GetTransport(); }
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); TransportCompany DrunkedTaxi = new DrunkAndTax("Drunk&Tax"); compService = DrunkedTaxi.Create("Пьяное такси", 4); Print(compService, 200); }
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); TransportCompany sCom = new SoberTransCom("Компания Трезвый водитель"); compService = sCom.Create("Услуга Трезвый водитель", 3); dist = 100; Print(compService, dist); Console.Read(); }
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); TransportCompany drCom = new DrunkDriverTransCom("Служба пьяный водитель"); compService = drCom.Create("Пьяный водитель", 3); double distdr = 200.0; Print(compService, distdr); }
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(); }
static void Main(string[] args) { TransportCompany trCom = new TaxiTransCom("Taxi Service"); TransportService compService = trCom.Create("Taxi", 1); double dist = 15.5; Print(compService, dist); TransportCompany gCom = new ShipTransCom("Shipping Service"); compService = gCom.Create("Shipping", 2); double distg = 150.5; Print(compService, distg); TransportCompany alcCom = new AlcDriverCom("Drunk driver"); compService = alcCom.Create("Drunk driver", 3); double distal = 80.5; Print(compService, distal); }
private static void Print(TransportService compTax, double distg) { Console.WriteLine("Компания {0}, расстояние {1}, стоимость: {2}", compTax.ToString(), distg, compTax.CostTransportation(distg)); }
private static void Print(TransportService compTax, double distg) { Console.WriteLine("Company {0}, distance {1}, cost: {2} ", compTax.ToString(), distg, compTax.CostTransportation(distg)); }
private static void printInfo(TransportService transpService, double distance) { Console.WriteLine("{0}, расстояние: {1}, стоимость: {2}" , transpService.ToString(), distance, transpService.CostTransportation(distance)); }