






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Midterm1Spring2006 Material Type: Exam; Professor: Padua-Perez; Class: OBJECT-ORIENTED PROG II; Subject: Computer Science; University: University of Maryland; Term: Spring 2007;
Typology: Exams
1 / 11
This page cannot be seen from the preview
Don't miss anything!







First Name: _______________________ Last Name: _______________________ Student ID: _______________________ Section time ___________ TA: __________________________ I pledge on my honor that I have not given or received any unauthorized assistance on this examination. Your signature: _____________________________________________________________ General Rules (Read): This exam is closed book and closed notes. If you have a question, please raise your hand. Total point value is 100 points. The short answer questions are not essay questions. Strive to answer them in 1 or 2 sentences. Longer answers are not necessary and are discouraged. WRITE NEATLY. If we cannot understand your answer, we will not grade it (i.e., 0 credit). PUNT RULE : For any question, you may write PUNT, and you will get ¼ of the points for the question (rounded down). If you feel totally lost on a question, you are encouraged to punt rather than waste time writing down a bunch of vaguely related verbiage in hopes of getting some partial credit. Honors section questions only count for credit for students in the honors section. Grader Use Only: #1 (25) #2 (25) #3 (25) #4 (13) #5 (12) Total (100) Honors (10)
Problem 1 Software Development (25 pts) a. (5 pts) What is the primary difference between the waterfall model of software development and the unified model. b. (5 pts) Explain why good code coverage is important. c. (5 pts) Give an example of a specific bug that would not be addressed or helped by having good code coverage. d. (5 pts) What does Extreme Programming say about testing and why is it an important part of Extreme Programming? e. (5 pts) What are the advantages using the Model View Controller design pattern?
b. (12 pts) Consider the UML diagram below: Give minimal Java class declarations for classes A-F, that you can infer from this diagram. Don’t give any methods, just the class declaration header and declare what fields are indicated by this diagram.
d. (8 pts) Give an implementation of the iterator() method of IntegerRange that uses an anonymous inner class: public class IntegerRange implements Iterable
e. (8 pts) Write a method that has the following header: public static int getFirstIndexNotComplement(BitSet b1, BitSet b2) Remember that a BitSet represents a set of non-negative integers, and is implemented using an sequences of bits. The method will return the index of the first bit in b1 that is not a complement of the corresponding bit in b2 (in other words, it will give the lowest bit index that is not set in exactly one of b1 and b2). For example, for the sets {1, 2, 3, 4 } and {0, 3, 5, 6} the method will return 3 (the BitSet {1, 2, 3, 4} would be represented by the bit sequence 01111 and the BitSet { 0, 3, 5, 6} would be represented by the bit sequence 1001011). You will receive full credit if your implementation does not use a loop. We have included at the end of the exam information about BitSet methods you can use for this problem.
Assume we wish to test the following two methods: public class Util { /**
Honors Section Problem (10 pts) Lots of problems have been proven to be undecidable: not only the halting problems, but the book described other undecidable problems such as the tiling problem and domino snakes on the half plane. a) What general approach/technique might you use to show that a problem is undecidable? b) Say you are working at a company on a project, and the feature set for your project includes solving a problem that are you able to show is undecidable. What are the practical implications of this?