Beispiel #1
0
        static void Main(string[] args)
        {
            var festa = new Festa();

            festa.Convidados    = 12;
            festa.TipoBebida    = "normal";
            festa.TipoDecoracao = "chique";
            var total = festa.ValorTotalFesta(festa);

            Console.WriteLine("Valor total: " + total);

            Console.ReadKey();
        }
Beispiel #2
0
        public decimal ValorTotalFesta(Festa festa)
        {
            decimal total;

            this.Bebidas        = 1;
            this.CustoDecoracao = 1;

            total = custoDecoracao + ((ValorPorConvidado + bebidas) * festa.Convidados);

            if (TipoBebida == "saudavel")
            {
                return(total * .95M);
            }
            else
            {
                return(total);
            }
        }