Warmup Question: What happens when you try to compile and run this code? public static int foo(int x) { for (int i = 0; i <= x; i++) { if (x % i == 0) { return i; } } } White: This code will not compile. Blue: This code will result in a run-time exception. Green: This code will return the first factor of x. Pink: This code will always return 0. Yellow: This code will always return 1. Answer: White Q1. Starting with an empty Vector of size 3, what would the array look like after executing the following. Assume that removeElementAt(int index) removes the element at the specified index, insertElementAt (Object o, int index) adds the element at the specified index. Also assume that capacity doubles when the array size needs to be increased. Vector v = new Vector(3); v.addElement("a"); v.addElement("b"); v.insertElementAt("c", 1); v.addElement("d"); v.removeElementAt(2); White: ___ ___ ___ ___ ___ ___ | || || || || || | |_|_||_|_||_|_||_|_||_|_||_|_| | | | | | | V V V V V V "a" "c" "b" "d" / / Blue: ___ ___ ___ ___ ___ ___ | || || || || || | |_|_||_|_||_|_||_|_||_|_||_|_| | | | | | | V V V V V V "a" "c" "d" / / / Green: ___ ___ ___ ___ ___ ___ | || || || || || | |_|_||_|_||_|_||_|_||_|_||_|_| | | | | | | V V V V V V "a" "c" / / / / Pink: ___ ___ ___ | || || | |_|_||_|_||_|_| | | | V V V "a" "c" / Yellow: ___ ___ ___ ___ ___ ___ | || || || || || | |_|_||_|_||_|_||_|_||_|_||_|_| | | | | | | V V V V V V "a" "b" "c" "d" / / Answer: Blue