C# exercise code when learning Head first C# and other books