Exceptions
Lists
100
What will this do?

String s = "b";
int.Parse(s);
Throw an exception
100
How do I create a new List of int's?
List<int> listOfInts = new List<int>();
200
What will this do?
StreamReader sr = new StreamReader("c:\does_not_exist.txt");
Throw a FileNotFoundException
200
How do I get this List's size?
List<String> someList = new List<String>();
someList.Count
300
What will this do?
int x = 5 / 0;
It will compile (it'll throw an exception at runtime).
300
Create a List of String's and put the first names of your team mates in it.
List<String> teamList = new List<String>();

teamList.Add("example1");
teamList.Add("example2");
400
What will this do?
try
{
Console.WriteLine("hi there");
} catch(Exception e)
{
Console.WriteLine("ERROR");
}
hi there
400
What will the following code do?
List<int> listOfInts = new List<int>();
int firstInt = listOfInts[1];
It will compile, but throw a ArgumentOutOfRangeException at runtime.
500
What will this do?
        static void ThrowsAnException()
        {
            int zero = 0;
            int y = 3 / zero;
            Console.WriteLine("I just tried to divide by zero");
        }

        static void Main(string[] args)
        {
            try
            {
                ThrowsAnException();
            }
            catch(DivideByZeroException e)
            {
                Console.WriteLine("ERROR: You tried to divide by zero");
            }
        }
ERROR: You tried to divide by zero
500
Will will this do?
            List<int> listOfInts = new List<int>();
            listOfInts.Add(3);
            listOfInts.Add(2);
            listOfInts.Add(1);
            foreach(int i in listOfInts)
            {
                Console.WriteLine(i);
            }
3 2 1
M
e
n
u