Exemplo n.º 1
0
        static void Main(string[] args)
        {
            IBankAccount saver = new SaverAccount();
            IBankAccount gold  = new GoldAccount();

            saver.Deposit(1250.75M);
            Console.WriteLine($"after deposit...{saver.ToString()}");
            saver.Withdraw(700.50M);
            Console.WriteLine($"after withdrawal of $700.50...{saver.ToString()}");

            gold.Deposit(5000.38M);
            Console.WriteLine($"after deposit...{gold.ToString()}");
            gold.Withdraw(5678.90M);
            Console.WriteLine($"after (failed)withdrawal of $5678.90...{gold.ToString()}");
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            GoldAccount  theGoldAccount  = new GoldAccount(80000.50M);
            SaverAccount theSaverAccount = new SaverAccount(5525.25M);

            theGoldAccount.withdraw(90000M);
            theSaverAccount.withdraw(20M);

            theGoldAccount.deposit(55.50M);
            theSaverAccount.deposit(25M);

            //Console.WriteLine(String.Format("Gold Account Member Balance: = {0,6:C}", theGoldAccount.Balance));
            //Console.WriteLine(String.Format("Saver Account Member Balance: = {0,6:C}", theSaverAccount.Balance));

            Console.WriteLine(theGoldAccount.ToString());
            Console.WriteLine(theSaverAccount.ToString());
        }