示例#1
0
        static void Main(string[] args)
        {
            IBank friendlyBank = new ArrayBank(50);
            Random rand = new Random();

            friendlyBank.StoreAccount(new CustomerAccount("Rob", (decimal) rand.Next(101) * 100));
            friendlyBank.StoreAccount(new CustomerAccount("Rudi", (decimal)rand.Next(101) * 100));
            friendlyBank.StoreAccount(new CustomerAccount("Toni", (decimal)rand.Next(101) * 100));
            friendlyBank.StoreAccount(new CustomerAccount("Per", (decimal)rand.Next(101) * 100));
            friendlyBank.PrintAccountList();
            Console.ReadKey();
        }
示例#2
0
    public static void Main()
    {
        ArrayBank ourBank = new ArrayBank(100);

        Account newAccount = new Account("Rob", "Robs House", 1000000);

        if (ourBank.StoreAccount(newAccount) == true)
        {
            Console.WriteLine("Account added to bank");
        }

        IAccount storedAccount = ourBank.FindAccount("Rob");

        if (storedAccount != null)
        {
            Console.WriteLine("Account found in bank");
        }
    }