コード例 #1
0
        /// <summary>
        /// Prompts the client to enter a coin.
        /// </summary>
        /// <returns>String representation of the client's coin.</returns>
        private static string getCoinFromUser()
        {
            string coinFromClient = string.Empty;
            string message        = string.Format(
                @"Please enter coin:{0}",
                Environment.NewLine);

            UIInterface.PrintToCMD(message);
            coinFromClient = UIInterface.GetInputFromUser();

            return(coinFromClient);
        }
コード例 #2
0
        /// <summary>
        /// Prompts the client to confirm the purchase or get a refund.
        /// </summary>
        /// <returns>Correlating int input.</returns>
        private static int clientConfirmPurchaseOrRefund()
        {
            string userInput;

            string message = string.Format(
                @"Choose 'Confirm' to complete the purchase or 'Refund' to cancel:{0}
 1. Confirm{0}
 2. Refund{0}",
                Environment.NewLine);

            UIInterface.PrintToCMD(message);
            userInput = UIInterface.GetInputFromUser();

            return(int.Parse(userInput));
        }