CPSC 112 Midterm: CS 112 Yale 13 Spring a Midterm Solution
Document Summary
Cis 110 spring 2013 midterm, 12 february 2013, answer key: (1 points) Miscellaneous (a) write your name, recitation number, and pennkey (username) on the front of the exam. (b) sign the certi cation that you comply with the penn academic integrity code. Identify 7 bugs in the program below that will prevent it from compiling or running. For each bug, give the line number and corrected line of code. Since this program is loony anyway, we will accept any reasonable x that allows the program to compile and run without error. You do not need to worry about the program"s purpose. public static void main(string args) { return; int input = args[0]; if (input < 1) System. out. println("" + arr[j]); public static string foofoo(int i, int j) { Bug 7: 17: else -or- if (i >= j) -or- insert add return statement at line 19 -or- 7: for (int j = 0; j < arr. length; j += 1) remove line 17.