Exemplo n.º 1
0
        // method for calculate the total sales tax
        public double TotalSalesTax()
        {
            // calculate the total sales tax amount
            for (int i = 0; i < item.Length; i++)
            {
                tax = new Tax();
                tax.CalculateTax(item[i]);
                totaltax = totaltax + tax.TotalTaxAmount();
            }

            //return the rounded up to the nearest 0.05) amount of sales tax
            return Math.Ceiling(totaltax * 20) / 20;
        }
        // method for calculate the total sales tax
        public double TotalSalesTax()
        {
            // calculate the total sales tax amount
            for (int i = 0; i < item.Length; i++)
            {
                tax = new Tax();
                tax.CalculateTax(item[i]);
                totaltax = totaltax + tax.TotalTaxAmount();
            }

            //return the rounded up to the nearest 0.05) amount of sales tax
            return(Math.Ceiling(totaltax * 20) / 20);
        }