예제 #1
0
        static void Main(string[] args)
        {
            Liquor vodka = new Liquor(95);

            Console.WriteLine(vodka);

            IVisitor endOfYearVisitor = new EndOfYearTax();

            Console.WriteLine($"Price after tax = {vodka.Accept(endOfYearVisitor)}");

            // Create new perfume

            Perfume channel = new Perfume(400);

            Console.WriteLine(channel);

            // Create new visitor

            IVisitor oneShekelVisitor = new OneShekelSale();

            Console.WriteLine($"Price after sale = {channel.Accept(oneShekelVisitor)}");

            // Create new shop rent

            ShopRent castro = new ShopRent(10000);

            Console.WriteLine(castro);
            Console.WriteLine($"Price after tax = {castro.Accept(endOfYearVisitor)}");
            Console.WriteLine($"Price after sale = {castro.Accept(oneShekelVisitor)}");
        }
예제 #2
0
        static void Main(string[] args)
        {
            Liquor vodka = new Liquor(95);

            Console.WriteLine(vodka);
            IVisitor vodkaEndOfYearVisitor = new EndOfYearTax();

            Console.WriteLine($"Price after tax = {vodka.Accept(vodkaEndOfYearVisitor)}");

            Perfume boss = new Perfume(100);

            Console.WriteLine(boss);
            IVisitor bossEndOfYearVisitor = new EndOfYearTax();

            Console.WriteLine($"Price after tax = {boss.Accept(bossEndOfYearVisitor)}");

            IVisitor bossOneShekelPrice = new OneShekelPrice();

            Console.WriteLine($"Price after One Shekel Sale = {boss.Accept(bossOneShekelPrice)}");

            ShopRent shop = new ShopRent(1000);

            Console.WriteLine(shop);
            IVisitor shopEndOfYearVisitor = new EndOfYearTax();

            Console.WriteLine($"Price after tax = {shop.Accept(shopEndOfYearVisitor)}");
        }
예제 #3
0
        static void Main(string[] args)
        {
            // Liquer

            Liquor vodka = new Liquor(95);

            Console.WriteLine(vodka);

            IVisitor endOfYearVisitor = new EndOfYearTax();

            Console.WriteLine($"Price after tax = {vodka.Accept(endOfYearVisitor)}");

            // Perfume

            Perfume per = new Perfume(500);

            Console.WriteLine(per);

            IVisitor OneIlsVisitor = new OneILSSale();

            Console.WriteLine($"Price after tax = {per.Accept(OneIlsVisitor)}");


            // ShopRent

            ShopRent shop = new ShopRent(5000);

            Console.WriteLine(shop);

            Console.WriteLine($"Price after tax = {shop.Accept(endOfYearVisitor)}");
        }
예제 #4
0
        static void Main(string[] args)
        {
            Liquor vodka = new Liquor(95);

            Console.WriteLine(vodka);

            Perfume perfume = new Perfume(300);

            Console.WriteLine(perfume);

            IVisitor endOfYearTax  = new EndOfYearTax();
            IVisitor oneShekelSale = new OneShekelSale();

            Console.WriteLine($"Vodka price after end of year tax = {vodka.Accept(endOfYearTax)}");
            Console.WriteLine($"Perfume price after one shekel sale = {perfume.Accept(oneShekelSale)}");
        }
예제 #5
0
        static void Main(string[] args)
        {
            Liquor   vodka    = new Liquor(95);
            Perfume  calvin   = new Perfume(300);
            ShopRent shopRent = new ShopRent(4500);

            IVisitor endOfYearVisitor = new EndOfYearTax();
            IVisitor oneShekelSale    = new OneShekelSale();

            Console.WriteLine(vodka);
            Console.WriteLine($"vodka after tax = {vodka.Accept(endOfYearVisitor)}");
            Console.WriteLine($"vodka after sale = {vodka.Accept(oneShekelSale)}");
            Console.WriteLine(calvin);
            Console.WriteLine($"calvin after tax = {calvin.Accept(endOfYearVisitor)}");
            Console.WriteLine($"calvin after sale = {calvin.Accept(oneShekelSale)}");
            Console.WriteLine(shopRent);
            Console.WriteLine($"shopRent after tax = {shopRent.Accept(endOfYearVisitor)}");
            Console.WriteLine($"shopRent after sale = {shopRent.Accept(oneShekelSale)}");
        }
예제 #6
0
        static void Main(string[] args)
        {
            Perfume vodka = new Perfume(95);

            Console.WriteLine(vodka);

            IVisitor endOfYearVisitor = new EndOfYearTax();

            Console.WriteLine($"Price after tax = {vodka.Accept(endOfYearVisitor)}");

            IVisitor oneShekelVisitor = new OneShekelProduct();

            Console.WriteLine($"Price after one shekel price = {vodka.Accept(oneShekelVisitor)}");

            ShopRent shopRent = new ShopRent(100000);

            Console.WriteLine(shopRent);

            Console.WriteLine($"Price after one shekel price = {shopRent.Accept(oneShekelVisitor)}");
        }
예제 #7
0
        static void Main(string[] args)
        {
            Liquor   vodka = new Liquor(95);
            Perfume  perf  = new Perfume(100);
            ShopRent shop  = new ShopRent(10000);

            Console.WriteLine(vodka);
            Console.WriteLine(perf);
            Console.WriteLine(shop);

            IVisitor endOfYearVisitor     = new EndOfYearTax();
            IVisitor oneShekelSaleVisitor = new OneShekelSaleTax();

            Console.WriteLine($"Price after tax = {vodka.Accept(endOfYearVisitor)}");
            Console.WriteLine($"Price after tax = {perf.Accept(endOfYearVisitor)}");
            Console.WriteLine($"One shekel sale = {vodka.Accept(oneShekelSaleVisitor)}");
            Console.WriteLine($"One shekel sale = {perf.Accept(oneShekelSaleVisitor)}");
            Console.WriteLine($"Price after tax = {shop.Accept(endOfYearVisitor)}");
            Console.WriteLine($"One shekel sale = {shop.Accept(oneShekelSaleVisitor)}");
        }
예제 #8
0
        static void Main(string[] args)
        {
            Liquor vodka = new Liquor(95);

            Console.WriteLine(vodka);

            Perfume perfume = new Perfume(10);

            ShopRent shopRent = new ShopRent(100);

            IVisitor endOfYearVisitor     = new EndOfYearTax();
            IVisitor oneShekelSaleVisitor = new OneShekelSale();

            Console.WriteLine($"Price after liquor tax = {vodka.Accept(endOfYearVisitor)}");
            Console.WriteLine($"Price after prefume tax = {perfume.Accept(endOfYearVisitor)}");
            Console.WriteLine($"Price after rent tax = {shopRent.Accept(endOfYearVisitor)}");

            Console.WriteLine($"Price after liquor sale = {vodka.Accept(oneShekelSaleVisitor)}");
            Console.WriteLine($"Price after prefume sale = {perfume.Accept(oneShekelSaleVisitor)}");
            Console.WriteLine($"Price after rent sale = {shopRent.Accept(oneShekelSaleVisitor)}");
        }
예제 #9
0
 public double Visit(Perfume perfume)
 {
     return(perfume.Price * 0.7);
 }
예제 #10
0
 public double Visit(Perfume perfume)
 {
     return(1);
 }
예제 #11
0
 public double Visit(Perfume perfume)
 {
     return(FIXED_PRICE);
 }
예제 #12
0
 public double Visit(Perfume perfume)
 {
     return(perfume.price * 0.95);
 }