static void Main(string[] args) { GumballMachine machine = new GumballMachine(2); machine.InsertsQuarter(); machine.TurnsCrank(); machine.DispenseGumball(); machine.InsertsQuarter(); machine.EjectQuarter(); machine.InsertsQuarter(); machine.InsertsQuarter(); machine.TurnsCrank(); machine.DispenseGumball(); machine.InsertsQuarter(); machine.TurnsCrank(); machine.DispenseGumball(); machine.Refill(); machine.InsertsQuarter(); machine.TurnsCrank(); machine.DispenseGumball(); machine.InsertsQuarter(); machine.EjectQuarter(); machine.InsertsQuarter(); machine.InsertsQuarter(); machine.TurnsCrank(); machine.DispenseGumball(); Console.ReadKey(); }
public static void Main(string[] args) { GumballMachine gumballMachine = new GumballMachine(2); Console.WriteLine(gumballMachine); gumballMachine.InsertQuarter(); gumballMachine.TurnCrank(); Console.WriteLine(gumballMachine); gumballMachine.InsertQuarter(); gumballMachine.TurnCrank(); gumballMachine.InsertQuarter(); gumballMachine.TurnCrank(); gumballMachine.Refill(5); gumballMachine.InsertQuarter(); gumballMachine.TurnCrank(); Console.WriteLine(gumballMachine); Console.ReadKey(); }