CPSC 112 Midterm: CS 112 Yale 13 Spring a Midterm Solution

18 views5 pages
31 Jan 2019
Course
Professor

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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers

Related Documents