public bool InsertCoin(ICoin coinType) { if (IsValid(coinType)) { amount += coinType.Value; coinHandler.InsertCoin(coinType.Type(), 1); display = "$" + amount.ToString(); return(true); } else { return(false); } }
public bool IsValid(ICoin usCoin) { return((usCoin.Type() == CoinTypes.USNickel || usCoin.Type() == CoinTypes.USDime || usCoin.Type() == CoinTypes.USQuarter) ? true : false); }