Object Oriented Programming using C#
Generic Collections and how to Serialize them
static void Main(string[] args)
{
Bank b = new Bank();
Account a;
a = new Account(“Alice”,”06/12/1963”);
b.AddAccount(a);
a = new Account(“Bert”, “14/08/1990”);
b.AddAccount(a);
a = new Account(“Claire”,”1/1/2000”);
b.AddAccount(a);
// Display the accounts
foreach (Account acc in b.Accounts)
{
Console.WriteLine(acc.ToString());
}
Account a1 = b.GetAccount(“Bert”, “14/08/1990”);
a1.DepositMoney(100);
// Display the accounts again
foreach (Account acc in b.Accounts)
{
Console.WriteLine(acc.ToString());
}
Console.ReadLine();
}
© UBS 2010. All rights reserved.
http://www.ubs.com/graduates
Looking for a career where your ideas could really make a difference? UBS’s
Graduate Programme and internships are a chance for you to experience
for yourself what it’s like to be part of a global team that rewards your input
and believes in succeeding together.
Wherever you are in your academic career, make your future a part of ours
by visiting http://www.ubs.com/graduates.
You’re full of energy
and ideas. And that’s
just what we are looking for.
Please click the advert