private void AddBeverageBtn_Click(object sender, EventArgs e) { button2.Enabled = true; switch (DecoratorCB.SelectedItem) { case "Mocha": coffee = new Mocha(coffee); break; case "Latte": coffee = new Milk(coffee); break; case "Caramel": coffee = new Caramel(coffee); break; case "Iced": coffee = new Ice(coffee); break; } double x = coffee.Cost(); user.Compute(this, BillTB.Text, bill); bill += x; string BillText = $"\n {coffee.GetDescription()}\t\t{x} tl \n "; BillTB.Text += BillText; }
public override double Cost() => coffee.Cost();