Sp09m1Crit - CS307 Spring 2009 Midterm 1 Solution and...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CS307 Spring 2009 Midterm 1 Solution and Grading Criteria. Grading acronyms ABA - Answer by Accident AIOBE - Array Index out of Bounds Exception may occur BOD - Benefit of the Doubt. Not certain code works, but, can't prove otherwise ECF - Error carried forward. Gacky or Gack - Code very hard to understand even though it works or solution is not elegant. (Generally no points off for this.) GCE - Gross Conceptual Error. Did not answer the question asked or showed fundamental misunderstanding NAP - No answer provided. No answer given on test NN - Not necessary. Code is unneeded. Generally no points off NPE - Null Pointer Exception may occur OBOE - Off by one error. Calculation is off by one. 1. Answer as shown or -2 unless question allows partial credit. No points off for differences in spacing and capitalization. If quotes included, okay. A. 20 5 B. false C. [3, 1] (comma differences and brace differences okay, just need 3 and 1 in that order.) D. exception. (All that requires is exception or runtime error or ArrayIndexOutOfBounds error. Just error is -2.) E. assertions (or assert statements) 1 point if statement / throw IllegalArgumentException 1 point (or words to that effect) F. 2 G - I. Can be other than valid / invalid. Some way of saying declaration is okay or not. Explanations NOT needed G. 1: invalid (GroundUnit does not implement Movable) 2: invalid (Can't instantiate (create) objects that are interfaces) H. 1: valid, 2: invalid (Object variables can't refer to types that are ancestors) I. 1: valid, 2: invalid (Same as G.1.) J. genI 20 K. MaxI 15 L. The code does not compile because the Tank class does not have a default constructor. (Or words to that effect. -1 allowed if answer is close.) M. 4
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
N. TexII 25 O. The code does not compile because the declared type of the variable m5 is Movable so only methods from that type (interface) can be called. (Or words to that effect. -1 allowed if answer is close.) ------------------------------------------------------------------------------- 2. Comments: A simple problem of implementing a class with some interesting
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern