Esempio n. 1
0
        static void TestAccountv3()
        {
            Accountv3 account = new Accountv3("1234567890", "Test Account", 100000.00);

            //We now want to check the balance
            account.GetBalance();
            //We can now debit and credit the account and the account will handle it's properties
            account.CreditAccount(1000);
            account.DebitAccount(1000);
        }
Esempio n. 2
0
 static bool WithDrawal(Accountv3 acc)
 {
     Console.WriteLine("How much would you like to Withdraw");
     try
     {
         double amt;
         double.TryParse(Console.ReadLine(), out amt);
         acc.DebitAccount(amt);
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Esempio n. 3
0
        static bool Deposit(Accountv3 acc)
        {
            Console.WriteLine("How much would you like to Deposit");
            double amt = 0.00;

            try
            {
                double.TryParse(Console.ReadLine(), out amt);
                acc.CreditAccount(amt);
                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Esempio n. 4
0
 static void CheckBalance(Accountv3 acc)
 {
     Console.WriteLine($"Account Balance is : {acc.GetBalance()}");
 }
Esempio n. 5
0
 static void Greet(Accountv3 acc)
 {
     Console.WriteLine($"Hi {acc.AccountName}");
 }