using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace BankSystem { class Program { static void Main(string[] args) { // Create a Bank object, add some accounts, do some operations, and then save the accounts. Bank theBank = new Bank(); theBank[123] = new BankAccount("John"); theBank[456] = new BankAccount("Mary"); theBank[789] = new BankAccount("Sam"); BankAccount acc1 = theBank[123]; acc1.Deposit(100); acc1.Deposit(300); acc1.Withdraw(200); BankAccount acc2 = theBank[456]; acc2.Deposit(1000); acc2.Deposit(3000); acc2.Withdraw(2000); BankAccount acc3 = theBank[789]; acc3.Deposit(10000); acc3.Deposit(30000); acc3.Withdraw(20000); theBank.SaveAccounts(); // Create a different Bank object, load in the accounts, and verify they've been loaded in correctly. Bank anotherBank = new Bank(); anotherBank.LoadAccounts(); if (anotherBank.ContainsAccountID(123)) { Console.WriteLine("Account 123: {0}", anotherBank[123]); } if (anotherBank.ContainsAccountID(456)) { Console.WriteLine("Account 456: {0}", anotherBank[456]); } if (anotherBank.ContainsAccountID(789)) { Console.WriteLine("Account 789: {0}", anotherBank[789]); } Console.ReadLine(); } } }