public static void Main(string [] args) { CashSuper cs = CashFactory.CreateCashAccept(cbxType.SelectedItem.ToString()); double totalPrices = 0d; totalPrices = cs.acceptCash(Convert.ToDouble(txtPrice.Text) * Convert.ToDouble(txtNum.Text) + totalPrices); total += totalPrices; }
public static void Main1(string[] args) { double total = 0.0d; CashSuper csuper = CashFactory.createCashAccept("80% discount"); double totalPrices = csuper.acceptCash(288 * 3); total = total + totalPrices; Console.WriteLine("Result : {0}", total); }
private double SetType(CashType type, double price, double num) { CashSuper cashsuper = CashFactory.createCashAccept(type); double totalPrices = 0d; totalPrices = cashsuper.AcceptCash(price * num); return(totalPrices); }