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(); }
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); } }