예제 #1
0
        public static void Main()
        {
            Console.WriteLine("Time Wypisany z 3 properties");
            Time t01 = new Time(12, 22, 09);

            Console.WriteLine(t01);

            Console.WriteLine("Time wypisany z formatu string");
            Time t02 = new Time("12:32:11");

            Console.WriteLine(t02);

            Console.WriteLine("TimePeriod wypisany z properties sekundy");
            TimePeriod tp01 = new TimePeriod(6352);

            Console.WriteLine(tp01);

            Console.WriteLine("TimePeriod wypisany formatu string");
            TimePeriod tp02 = new TimePeriod("6:42:19");

            Console.WriteLine(tp02);

            Console.WriteLine("Dodawanie Time Metodą Plus");
            t01.Plus(tp02);
            Console.WriteLine(t01);

            Console.WriteLine("Dodawanie TimePeriod metodą Plus");
            TimePeriod tp05 = TimePeriod.Plus(tp02, tp01);

            Console.WriteLine(tp05);
        }
예제 #2
0
        public static void Main()
        {
            Time time = new Time(12, 25, 23);

            Console.WriteLine("Time: " + time);

            Time time1 = new Time(12);

            Console.WriteLine("Time 1 parametr: :" + time1);

            Time time2 = new Time("12:25:23");

            Console.WriteLine("Time string: " + time2);

            TimePeriod tp01 = new TimePeriod(86491);

            Console.WriteLine("TimePeriod: " + tp01);

            TimePeriod tp02 = new TimePeriod("129:58:12");

            Console.WriteLine("TimePeriod string: " + tp02);

            Console.WriteLine("Dodawanie Time Metodą Plus");
            time.Plus(tp02);
            Console.WriteLine(time);

            Console.WriteLine("Dodawanie TimePeriod metodą Plus");
            TimePeriod tp05 = TimePeriod.Plus(tp02, tp01);

            Console.WriteLine(tp05);
        }
        static void Main(string[] args)
        {
            Time t1 = new Time();

            Console.WriteLine("Time bez podania argumentów: " + t1);

            Time t2 = new Time("12:00:59");

            Console.WriteLine("Time po podaniu stringa do konstruktora: " + t2);

            Time t3 = new Time(22, 0, 63);

            Console.WriteLine("Time po podaniu trzech argumentów do konstruktora: " + t3);

            TimePeriod tp1 = new TimePeriod();

            Console.WriteLine("TimePeriod bez podania argumentów: " + tp1);

            TimePeriod tp2 = new TimePeriod(8000);

            Console.WriteLine("TimePeriod po podaniu liczby sekund do konstruktora: " + tp2);

            TimePeriod tp3 = new TimePeriod("3432:19");

            Console.WriteLine("TimePeriod po podaniu stringa do konstruktora: " + tp3);

            TimePeriod tp4 = new TimePeriod(432412, 22, 55);

            Console.WriteLine("TimePeriod po podaniu trzech argumentów do konstruktora: " + tp4);

            TimePeriod tp5 = new TimePeriod(t1, t2);

            Console.WriteLine("TimePeriod po podaniu argumentów w postaci struktury Time do konstruktora: " + tp5);


            Console.WriteLine("Dodawanie TimePeriod do Time: " + t1.Plus(tp2));
            Console.WriteLine("Dodawanie TimePeriod do TimePeriod: " + tp3.Plus(tp4));
            Console.WriteLine("Odejmowanie TimePeriod od TimePeriod: " + tp3.Minus(tp2));
        }