示例#1
0
文件: ATM.cs 项目: bwc0/ATM-Project
        private static void NewAccount()
        {
            try
            {
                var accountType = prompt.AskForInt("Choose a number: 1. Checking " +
                                                   "2. Savings. 3. Investment");
                var pin     = prompt.AskForInt("Enter pin: ");
                var balance = prompt.AskForDecimal("Enter your starting balance: ");

                var decision = prompt.AskForString("Would you like " +
                                                   "overdraft protect: y/n");

                account = bank.CreateAccount(user, accountType,
                                             pin, balance, decision);

                prompt.GiveMessage("\nAccount created.");
            }
            catch (FormatException fe)
            {
                prompt.GiveMessage(fe.Message);
            }
        }
示例#2
0
文件: Bank.cs 项目: bwc0/ATM-Project
        public void Withdrawl(Account account)
        {
            var withdrawlAmount = prompt.AskForDecimal("Enter number to withdrawl: ");

            account.Debit(withdrawlAmount);
        }