Esempio n. 1
0
 static void Main(string[] args)
 {
     SalesTaxMonitor vatMonitor = new SalesTaxMonitor();
     Chocolate chocolate = new Chocolate(20);// price 20
     SoftDrink drinks = new SoftDrink(40);// price 40
     Fruit apple = new Fruit(15);// price 15
     Console.WriteLine("The VAT summary");
     Console.WriteLine(chocolate.AddTaxMonitor(vatMonitor).ToString("#.##"));
     Console.WriteLine(drinks.AddTaxMonitor(vatMonitor).ToString("#.##"));
     Console.WriteLine(apple.AddTaxMonitor(vatMonitor).ToString("#.##"));
     Console.ReadLine();
 }
Esempio n. 2
0
        static void Main(string[] args)
        {
            SalesTaxMonitor vatMonitor = new SalesTaxMonitor();
            Chocolate       chocolate  = new Chocolate(20); // price 20
            SoftDrink       drinks     = new SoftDrink(40); // price 40
            Fruit           apple      = new Fruit(15);     // price 15

            Console.WriteLine("The VAT summary");
            Console.WriteLine(chocolate.AddTaxMonitor(vatMonitor).ToString("#.##"));
            Console.WriteLine(drinks.AddTaxMonitor(vatMonitor).ToString("#.##"));
            Console.WriteLine(apple.AddTaxMonitor(vatMonitor).ToString("#.##"));
            Console.ReadLine();
        }
Esempio n. 3
0
 public double AddTax(SoftDrink aDrink)
 {
     Console.WriteLine("State Tax Added with a Drink");
     return(aDrink.Price * 1.005);
 }
 public double AddTax(SoftDrink aDrink)
 {
     Console.WriteLine("Sales Tax Added with a Drink");
     return aDrink.Price*1.015;
 }