View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Spring 2004 Midterm 2 Review Page

Midterm 2 will include questions on the material covered since the first exam. Some questions that will help you prepare are found below. More will be added.

I recommend working together to figure out the solutions. I will check up on the discussions, but I won't provide answers where no questions are posted. Rich LeBlanc




Designing the Segway Palm


Palm has just announced a new kind of handheld device designed specifically for attaching to the Segway Personal Transportation device The new SegPalm will feature a map with GPS (``Global Positioning System'') for finding your way around town, an MP3 player and FM radio, a cellphone, and a Zagat's guide to the restauraunts around town, as well as the traditional appointment book, to-do list, and phonebook functions.

Palm wants some of these features to interoperate. For example:

  1. Draw a UML class diagram for the interactions between Maps, Locations, the address book, and the Zagat's guide, including any additional objects you think are necessary. You must account for all of the functionality described in this problem, but you needn't add any other (e.g., you don't have to handle the address book user interface). You do need to show attributes and services that would be necessary to implement the given functionality. Describe briefly what each of your services would do.

  2. Identify one design pattern that would be useful in this problem. Explain how it would be useful, and identify specific classes that you would use in a design for this problem that would correspond to the design pattern participant objects.

  3. Palm is using Squeak to implement the SegPalm. Imagine that you have an ordered collection errands of Location objects that represent places to which you have to run errands. You have a Map gridMap on which all the Locations appear. You are to write workspace code:

    1. To tell gridMap to highlightFor each of these Locations, and

    2. To ask each of the errands locations for its streetname (assume given, returns a string with the name of the street). For each street containing more than one errand location, print to the Transcript a message announcing ``There is more than one errand on street: '' with the street name.


Post comments, discussion, answers at Spring 04 Midterm 2 Review: Segway Palm.



Tools for Space Scientists


You are going to be designing a suite of tools for space scientists. Your scientists are going to need to work with three kinds of documents:





a. Explain how one (your choice which one) Design Pattern would be useful in building this application. Draw a UML class diagram of the portion of your design where the design pattern would be useful. (Note: You are not drawing the whole class diagram, nor are you showing me the structure of the Design Pattern. Rather, you are showing me a few classes in your application whose design would be based on the Design Pattern you've selected.)

b. The Space Scientists think this object-oriented stuff is just silly. "Fortran was good enough for my advisor and for me and for my students," they say. "Why not just use that?" What are the advantages of object-oriented design and programming for this problem?

Post comments, discussion, answers at Spring 04 Midterm 2 Review: Tools for Space Scientists




Design Patterns


a. Factory Method and Abstract Factory design patterns are quite similar. How are they similar and how are they different?

b. How are the Adapter and Bridge patterns similar and different?

Post comments, discussion, answers at Spring 04 Midterm 2 Review: Design Patterns



Testing Object-oriented Programs


a. How is testing an object-oriented program similar to testing any other kind of program?

b. What are the features of object-oriented programs that require new testing approaches? What impact do they have on the testing process?

c. Explain what unit testing means for an object-oriented system.

Post comments, discussion, answers at Spring 04 Midterm 2 Review: OO Testing


Multimedia Programming in Squeak


I probably won't ask you to write this much code on the exam, but knowing the techniques required would be a good idea.

Recall that you can play three notes in Squeak like this:

(AbstractSound noteSequenceOn:
    (FMSound soundNamed: 'brass1')
    from: #((c4 1.0 500) (d4 1.0 500) (e4 1.0 5000))) play
    "Triplet are note, duration, and volume"
(a) Recall, too, how to move a Pen, from wherever the Pen appears when first created.

Write the Squeak code to draw a box, where you play C in the fourth octave during the first line, D in the second, E in the third, and F in the fourth – as a clarinet.

(b) Recall that moving a Morph involves setting its bounds: to a new rectangle. Recall that you change the color of a Morph with a color: command.

Write the Squeak code to move a red EllipseMorph. Start it at 0,0 and play C; then go to 0,100 and play a D; then go to 100,100 and play an E; and finally go to 100,0 and play an F.

Post comments, discussion, answers at Spring 04 Midterm 2 Review: Multimedia Programming in Squeak



Whiz-O Toys


You are a consultant to the WhizO Toy Company ("Makers of toys for tots of all ages"). WhizO is considering a shift to an object-oriented software development process. If they do make such a shift, you're in for big bucks as the consultant who leads the way. First step is to respond to the specific concerns of the Manager of their Software Development unit:



Post comments, discussion, answers at Spring 04 Midterm 2 Review: Whiz-O Toys



Design an Alarm System


Design an alarm system for installation in homes or businesses. You may assume that someone else is creating sensors and the mechanism to trigger alarms. You have to create the software to respond to alarms and to alert authorities.


Draw the UML class diagram for this class structure. (You don't have to add more features than what's described.) Note: Partial credit will be given, so err on the side of too much, not too little. In your analysis, be sure to address:



Note! This is an important one!


Displaying the Current Status. You must now provide an interface for your alarms: An AlarmStatusView that shows that status (triggered by a sensor or still waiting) of each alarm.

How do you efficiently implement View/Model communication? Be sure to tell me (a) how the AlarmStatusView finds out an alarm being triggered and (b) how it finds the vicinity of the triggered alarm to display.

Post comments, discussion, answers at Spring 04 Midterm 2 Review: Displaying Alarm Status


Link to this Page