Example #1
0
        public void tax(int salary, int absenties)
        {
            float tax = 0;

            if (absenties > 10)
            {
                NBSException e = new NBSException();
                throw e;
            }
            else
            {
                tax = salary * 20 / 100;
                Console.WriteLine("Tax calculated = " + tax);
            }
        }
Example #2
0
        public void Tax(int salary, int absent)
        {
            float tax = 0;
            float net = 0;

            if (absent > 10)
            {
                NBSException E = new NBSException();
                throw E;
            }
            else
            {
                tax = salary * 20 / 100;
                net = salary - tax;
                Console.WriteLine("The salary tax is " + salary);
                Console.WriteLine("The total tax is " + tax);
                Console.WriteLine("The total net is " + net);
            }
        }