Esempio n. 1
0
        static void Main(string[] args)
        {
            NationWide X;

            X   = new NationWide();
            X.A = 20;
            X.B = 25;
            X.C = X.A + X.B;
            Console.WriteLine(X.C);

            operations opt;

            opt = new operations();
            opt.message();
            opt.add(5, 10);

            opt.salarySlip(2000);
            opt.salarySlip(1000);

            maths call;

            call = new maths();
            call.add(7, 15);
            call.sub(10, 5);
            call.div(100, 10);
            call.mult(5, 10);

            Console.Read();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            maths m = new maths();

            m.arrayProcessing(5);

            try
            {
                m.division(4, 0);
            } catch (DivideByZeroException e)
            {
                Console.WriteLine("Cannot divide by zero");
            }

            Finance f = new Finance();

            try
            {
                f.tax(2000, 12);
            } catch (NBSException e)
            {
                Console.WriteLine("Its ok");
            }

            try
            {
                f.tax(2000, 13);
            } catch (NBSException e)
            {
                Console.WriteLine("Not allowed");
            }

            Friend friend = new Friend();

            friend.go();
            friend.show();

            Sentence s = new Sentence();

            s.longestWord("Hello my friend how are you");

            Console.ReadKey();
        }