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

Final Exam Review - Summer 2002

The final will be cumulative, but with a strong focus on material in the second half of the class. Below are questions that are similar to the ones that will appear.

I expect the final exam in Summer 2002 CS2340 to be 6-8 questions like each of the below. Some of the questions below are from actual final exams in 2390 and 2340. 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. Barbara Ericson

Virtual Machines

a. Give three reasons why it may make sense to use a virtual machine instead of native code in an application or device.

b. Identify two features of the Java HotSpot and Squeak virtual machines that are common between them, and two other features that are different.

c. What takes up the majority of code (and probably execution time) in a primitive written for a virtual machine?

Post comments, discussion, answers at Sum02 Final Exam Review: Virtual Machines

eXtreme Programming

You're advising a team of developers who are considering adopting XP. Being an expert on XP, please answer their questions.

  1. "XP programmers don't document their code!?! How can their code still be readable after they write it?"

  2. "What in the world do they mean that code written by an individual has to be thrown away? What other kind of code is there?"

  3. "Integrating daily sounds like we'll spend all our time in integration. How can we make daily integration work more smoothly?"

  4. "Is there any evidence that this really works?"

Post comments, discussion, answers at Sum02 Final Exam Review: eXtreme Programming

Design Patterns

  1. What is a design pattern?

  2. Where did design patterns come from?

  3. Name one design pattern and explain when you would want to use it.

Post comments, discussion, answers at Design Patterns #2

OO Design Evaluation

You were hired to review the design and make suggestions for improvements on some object-oriented software. What would you say to each of the following and how would you fix any problems?

  1. This class is the main class and handles many of the tasks.

  2. We named the Warehouse class Ware becuase it is easier to type.

  3. We are getting tons of code written becuase there are things we can just copy from similar classes.

  4. We had one class inherit from another becuase the one class needed to access some information in the other class, but we had a problem that some of the inherited methods didn't make sense so we overrode them.

  5. We have a type attribute in the Payment class and then we case (switch) on the type to handle billing by credit card, purchase order, create a bill, etc.
  6. We had a guy who wanted to create about 10 classes but we found a way to do it in only 3!

  7. We put most of the code into class methods and that way we don't need to create objects to do the work!

Post comments, discussion, answers at Sum02 Final Exam Review: OO Design Evaluation

Extending your Drawing Editor

You want to extend your drawing editor so that it can be used by radiologist to mark-up a chest x-ray. The radiologist wants to load in a chest-xray and then add a shape (like a circle, polygon, etc) on an interesting spot in the x-ray. Then they want to annotate the shape with a sound file that describes what is interesting about the shape. They might also want to annotate the shape with the location and finding. Locations and findings can both have parents and children. For example a location is "Lungs". It has the parent "Chest". It has the children "Left Lung" and "Right Lung".

  1. One tool that you are missing is a pen-like tool that will create a shape starting with the first mouse down and following the mouse until a mouse release. The shape will be a series of connected lines. How would your design change to add this tool?

  2. Redraw the UML diagram to add the new classes you will need.

Post comments, discussion, answers at Sum02 Final Exam Review: drawingEditor

MVC vs. Morphic

a. Name an application where MVC is preferable to Morphic.

b. Name an application where Morphic is preferable to MVC.

c. Identify three major design differences between Morphic and MVC.

d. Can you use the MVC Paradigm in Morphic? Why or why not?

e. Name at least one commercial UI package today that is based on the MVC paradigm.

Post comments, discussion, answers at Sum02 Final Exam Review: MVC vs. Morphic

Choosing your collection objects

a. Identify a use where Arrays are the best choice, where Bags are the best choice, and where Dictionaries are the best choice.

b. For figuring out if an element is in the Collection, Sets are much, MUCH faster than Arrays. Why?

c. When are OrderedCollections much slower than Arrays? When are OrderedCollections almost the same speed as Arrays? What causes OrderedCollections to be slower?

Post comments, discussion, answers at Sum02 Final Exam Review: Choosing your collection objects

Multimedia Programming in Squeak

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 Sum02 Final Exam 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 Sum02 Final Exam Review: Whiz-O Toys

Helping the Video Game Industry

Given your experience with designing and implementing epic adventure games, you have been hired as a consultant to Electronic Arts as they develop their response to the Myst series of adventure games.

Post comments, discussion, answers at Sum02 Final Exam Review: Helping the Video Game Industry.

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:

Post comments, discussion, answers at Sum02 Final Exam Review: Designing Alarms.

Link to this Page