Пример #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();
 }
 public double AddTax(Fruit aFruit)
 {
     Console.WriteLine("Sales Tax Added with a Fruit");
     return aFruit.Price*1.015;
 }
 public double AddTax(Fruit aFruit)
 {
     Console.WriteLine("No State Tax fora Fruit");
     return aFruit.Price;
 }
 public double AddTax(Fruit aFruit)
 {
     Console.WriteLine("No source Tax for fruits");
     return(aFruit.Price);
 }