Exemplo n.º 1
0
        // Calculate the Toal TaxItem Amount
        public Hashtable CaluculateToalTaxItemAmount()
        {
            //create hashtable for store the total amount and item name
            Hashtable h = new Hashtable(item.Length);

            for (int i = 0; i < item.Length; i++)
            {
                tax = new Tax(); // create object for each item
                tax.CalculateTax(item[i]); // calculate the tax
                tot = tax.TotalItemAmount(item[i].Price,item[i].NoOfItems);// get the total amount
                h.Add(item[i].Name, tot); // Add in Hashatable
            }

            return h; // return heash table
        }
        // Calculate the Toal TaxItem Amount
        public Hashtable CaluculateToalTaxItemAmount()
        {
            //create hashtable for store the total amount and item name
            Hashtable h = new Hashtable(item.Length);

            for (int i = 0; i < item.Length; i++)
            {
                tax = new Tax();                                             // create object for each item
                tax.CalculateTax(item[i]);                                   // calculate the tax
                tot = tax.TotalItemAmount(item[i].Price, item[i].NoOfItems); // get the total amount
                h.Add(item[i].Name, tot);                                    // Add in Hashatable
            }

            return(h); // return heash table
        }