public void SelectDrink(int money) { Changer changer = new Changer(); string sel_str; int sel = 0; Console.Write("select : "); sel_str = Console.ReadLine(); try { sel = int.Parse(sel_str); } catch (FormatException e) { Console.WriteLine(e.Message); } switch (sel) { case 1: changer.ChangePay(money, WATER, D1); break; case 2: changer.ChangePay(money, COKE, D2); break; case 3: changer.ChangePay(money, COFFEE, D3); break; case 4: changer.ChangePay(money, JUICE, D4); break; default: Console.WriteLine("switch error"); break; } }