public static void Main()
Kangaroo joey = new Kangaroo();
Console.WriteLine(joey.Wombat(1));
Console.WriteLine(joey.Wombat(0));
Console.WriteLine(joey.Wombat(-3));
int koala = joey.Wombat(joey.Wombat(joey.Wombat(1)));
Console.WriteLine((15 / koala) + " eggs per pound");
catch (DivideByZeroException)
Console.WriteLine("G’Day Mate!");
public int Wombat(int wallaby)
fs = File.OpenWrite("wobbiegong");
AddText(fs, "This is some text");
AddText(fs, "This cccccccccccccccccis some more text,");
AddText(fs, "\r\nand this is on a new line");
fs = File.OpenRead("wobbiegong");
byte[] b = new byte[1024];
UTF8Encoding temp = new UTF8Encoding(true);
while (fs.Read(b,0,b.Length) > 0)
Console.WriteLine(temp.GetString(b));
private static void AddText(FileStream fs, string value)
byte[] info = new UTF8Encoding(true).GetBytes(value);
fs.Write(info, 0, info.Length);