Example #1
0
        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);
            }
        }
Example #2
0
        public void Withdrawl(Account account)
        {
            var withdrawlAmount = prompt.AskForDecimal("Enter number to withdrawl: ");

            account.Debit(withdrawlAmount);
        }