Hi There!

I'm Dan Schlegel, an Assistant Professor in the Computer Science Department at SUNY Oswego

Exam 1 Corrections

You may correct the first exam to receive half of the points you missed restored to your score. This is a one-time offer and won’t be available on future exams. We will round up, so if you missed 3 points on a question you will receive 2 back; if you missed 1, you will receive 1 back. You must correct every question you missed to receive any credit back. Only perfectly corrected answers will receive points back. Your corrections must be typed. Specific rules:

  • Part 1: A correction for a missed question will consist of (a) a correct definition, and (b) an example of the concept in working code. The code must be your own, properly formatted, and working. Show example output from your code.
  • Part 2, Question 1: Type up the XML file, and write the remaining code to read the XML file and do the operation indicated. Include the output of running your code. Explain how the code works in your own words.
  • Part 2, Question 2: Type up the example and run it. Include the output. Create drawings of the references/values as used in class to explain why you got the answers you did.
  • Part 3: Write the code. Add a Main class including a main method which creates several Cats/Dogs and a Human. Have the Human adopt the Cats/Dogs. Add a petAll() method to Human which loops through the ArrayList and calls pet() on each PetablePet. Call that method from your main method and include the output.

When writing text definitions / descriptions be sure that you are being precise, and using words appropriate to the context. For example, a common answer to one of the access modifiers was “Public – everyone can see it” – what do you mean by ‘everyone’? What is ‘it’?

Corrections are due March 7th in class. Turn in your corrections along with your original exam.