11 Problems for Old Exam - Advanced Object Oriented Design Programming | CS 635, Exams of Computer Science

Material Type: Exam; Class: ADV OBJ ORIENT DSGN PROG; Subject: Computer Science; University: San Diego State University; Term: Spring 2004;

Typology: Exams

Pre 2010

Uploaded on 03/28/2010

koofers-user-xrl
koofers-user-xrl 🇺🇸

5

(1)

10 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS 635 Spring 2002 Exam 3/11/04 Page 1 of 6
Name
Solve any 8 of the following 11 problems. Indicate which 8 problems you
are solving. Only 8 problems will be graded.
1. We have a Student class which has a method grade(). This method returns an integer
value, 4 for an A, 3 for a B, 2 for a C, 1 for a D and 0 for an F. We are going to write code
that will select students from a list with grades in a given range, for example grades
between 1 and 3. What conditions would you check for in your unit tests?
pf3
pf4
pf5

Partial preview of the text

Download 11 Problems for Old Exam - Advanced Object Oriented Design Programming | CS 635 and more Exams Computer Science in PDF only on Docsity!

Name

Solve any 8 of the following 11 problems. Indicate which 8 problems you

are solving. Only 8 problems will be graded.

  1. We have a Student class which has a method grade(). This method returns an integer value, 4 for an A, 3 for a B, 2 for a C, 1 for a D and 0 for an F. We are going to write code that will select students from a list with grades in a given range, for example grades between 1 and 3. What conditions would you check for in your unit tests?

2 Select one of the following patterns – Strategy, Composite or Iterator and discuss the consequences (good and bad) of the pattern. 3 The design patterns text uses two main design principles. Select one pattern that uses both principles. Show how it uses both.

  1. One issue in the composite pattern is who should declare the child management operations: the Composite or the Component classes. What are the trade-offs involved in deciding where to declare the child management operations.
  2. Show how the Null object pattern can be used to replace if (or case) statement.
  1. The Object Adapter and Proxy are similar in structure: both wrap an object. What is the difference between the Adapter and Proxy patterns? 9a. What is an external iterator? 9b. What is in internal iterator? 9c. Which is easier to implement on a Composite structure like a binary search tree?