Beispiel #1
0
        static void Main(string[] args)
        {
            Marvellous mobj = new Marvellous();

            Thread t1 = new Thread(new ThreadStart(mobj.Display));

            t1.Start();
        }
        static void Main(string[] args)
        {
            try
            {
                Console.WriteLine("Enter Joining Date:");
                DateTime joindate = DateTime.Parse(Console.ReadLine());

                if (DateTime.Today.Year < joindate.Year)
                {
                    throw new InvalidDateException("Invalid Date");
                }
                else
                {
                    Marvellous mobj = new Marvellous();
                    mobj.Display(joindate);
                }
            }
            catch (InvalidDateException e)
            {
                Console.WriteLine(e);
            }
        }
        static void Main(string[] args)
        {
            Console.WriteLine("Enter Size:");
            int size = Convert.ToInt32(Console.ReadLine());

            Marvellous <int> mobj = new Marvellous <int>(size);

            mobj.Accept();
            mobj.Display();
            mobj.BubbleSort();
            Console.WriteLine(mobj.BinarySearch(51));
            Console.WriteLine(mobj.LinearSearch(51));
            Console.WriteLine(mobj.LinearSearchBidirectional(21));

            Marvellous <char> charArray = new Marvellous <char>(size);

            charArray.Accept();
            charArray.Display();
            charArray.BubbleSort();
            Console.WriteLine(charArray.BinarySearch('M'));
            Console.WriteLine(charArray.LinearSearch('M'));
            Console.WriteLine(charArray.LinearSearchBidirectional('M'));
        }