Пример #1
0
        static void Main(string[] args)
        {
            ITarif tarif = new Tarif(5, 20, 3, 1);

            Console.WriteLine("Enter the distance, please:");
            double distance = double.Parse(Console.ReadLine());

            Console.WriteLine("Enter the delay, please:");
            double delay = double.Parse(Console.ReadLine());
            ITaxi  taxi  = new Taxi(distance, delay, (Tarif)tarif);

            Console.WriteLine("Your payment for taxi using is {0} uah", taxi.Payment);
            Console.ReadKey();
        }
Пример #2
0
 public Taxi(double distance, double delay, Tarif tarif)
 {
     this.Distance = distance;
     this.Delay    = delay;
     this.Tarif    = tarif;
 }