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 - Sum2000

I expect the final exam in Sum 2000 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.


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 Sum00 Final Exam Review: Tools for Space Scientists

A Sensor Management System

You are building a new kind of management system. Your system is going to be accepting a continuous stream of data which will be the merged data from many sensors. Your application must make appropriate sense of it. Your stream will be a series of two byte integers (i.e., in the range of 0-65536), which you will read using next off the stream accessed by the global variable SensorStream. That is, SensorStream next will always return an integer between 0 and 65536. Answers can be written below or on the back.

a. The integer value 0 will actually be a flag value indicating a Character Display Message. A reading of 0 is telling you that the next two readings are to be interpreted as an X and Y value and the third reading will be the ASCII value for a character. So, the readings 0 10 100 65 would tell you to put an ASCII capital A at the position 10, 100 on the screen. Write the Squeak code to read the first 100 readings off of SensorStream and process any Character Display Messages contained in those readings. (Hint: Character value: returns a character for a given ASCII value, Strings understand the message displayAt: which takes a Point.)

b. Some key events require you to correlate readings from multiple sensors. For example, a sound sensor gets triggered with random noise, but if the sound sensor gets triggered multiple times and the motion sensor in the same room gets triggered, that indicates an alarm must be thrown. Readings in the range of 1-255 indicate that the corresponding sound sensor has gone off. Readings in the range of 256-511 indicate that the corresponding motion sensor has gone off. For example, a value of 1 indicates that sound sensor 1 has been triggered, and a value of 256 indicates that motion sensor 1 has been triggered.

Write code to read 100 values off SensorStream. If values between 1 and 255 come in, record the value and the number of times that that value has appeared (e.g., "5 appeared three times"). If a value between 256 and 511 comes in, put up ëALARM!í in a notifier if the corresponding sound sensor has gone off more than three times. (Hint: Object understands inform: that takes a string, then pops up a notifer with the string.) Besides writing the code, also tell me which data structure you used for recording and quickly finding the values and why you made that choice.

Post comments, discussion, answers at Sum00 Final Exam Review: Sensor Management System


Soccer Moms Communications System

You are part of a design team for a new Beeper-WebBrowser-CellPhone-GarageDoorOpener device. Help make these design decisions and provide rationale for them.

a. Your team has decided to use Squeak, but canít decide whether to use Morphic or MVC for the UI. Which would you recommend and why? (Remember: Concrete, arguable-to-management rationale.)


b. Your Marketing Department says that your device is going to be most useful to constantly traveling, over-worked, Suburban "Soccer Moms" (especially the feature of being able to open the garage door while talking on the phone). What should you do now, before your project starts designing the software or interface, to make sure that the interface is usable by your audience?

c. Your team finds that their code is a bit too slow in Squeak. Give them some suggestions for what they can do next. Your answer should include both (a) how to figure out where the slow parts are and (b) speeding up the slow parts. (Hint: Algorithm changes, constructing primitives, and even improving the VM are all available options to you.)

Post comments, discussion, answers at Sum00 Final Exam Review: Soccer Moms Communication System


UML

Name one other UML diagram besides a class diagram, and describe what it's good for.

Post comments, discussion, answers at Sum00 Final Exam Review: UML



Redesigning the Math Equation Tool

Mathematica has hired you to your Math Equation Tool again, but for them, as a real product (implented in Squeak, still, of course! :-). Reconsider the design decisions that you made this term and describe how you would design it again.

a. How would you parse? Build a new one in T-Gen from scratch or build one recursive descent or what? Give a rationale for your choice.

b. What design patterns might you use that we discussed in class?

c. Design the classes for your system. Draw a UML class diagram.

Post comments, discussion, answers at Sum00 Final Exam Review: Redesigning the Math Equation Tool


Designing Networked Games

You are responsible for design and development of a new video game based on the Rugrats cartoon series on Nickelodeon. The video game will allow players to take on the roles of Tommy, Chuckie, Angelica, Phil, and Lil, and then interact to work through puzzles. The players will sit all over the network, and it's desirable to be entirely cross-platform. You must make several technical decisions up front.

a. Do you use a virtual machine? Why or why not?

b. How do you want to transmit the images of Tommy, Chuckie, and the rest? Some of your teams want to send around 3-D models of them, and others want to use Flash. What do you think and why?

c. There will be need for various kind of audio in this game: Background music based on the cartoon, recordings of the voices. What formats do you think you would want to use and why?

Post comments, discussion, answers at Sum00 Final Exam Review: Design Networked Games


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 Sum00 Final Exam Review: Choosing your collection objects


Transposing a Dictionary

Imagine that you have a dictionary that looks like this:

Key Value
Fred Wilma
Barney Betty
George Martha
Ozzie Harriet

And you want to create the transpose of the dictionary so that it looks like this:

Key Value
Wilma Fred
Betty Barney
Martha George
Harriet Ozzie

Do it. Try to do it in one line of code.

Post comments, discussion, answers at Sum00 Final Exam Review: Transposing a Dictionary


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.

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



HCI Design

A company has just designed a user interface that was an utter disaster. You have been brought in as an HCI consultant to explain what they did wrong. For each of the below quotes from the companies engineers, respond and explain what they should have done.

a. "We used it ourselves for over a week! We really loved it! I can't understand why we're getting all these nasty letters from our users!"

b. "We wanted to save on screen real estate so we used 9 point text throughout the user interface. Well, now it turns out that all these Senior Citizens homes bought our software. Did you know that older folks have trouble with reading smaller text?"

c. "All of us felt that OK and Cancel buttons in the lower right hand corner were boring. So instead, if you click at the top of the dialog box, it closes as if you did 'OK,' and if you click at the bottom, it closes as if you clicked 'Cancel.' What's that? No, we didn't use any labels – they would just take up screen real estate."

Post comments, discussion, answers at Sum00 Final Exam Review: HCI Design


Tradeoffs:
A. What are the strengths and weaknesses of the Model-View-Controller structure for user interfaces? Give me an example of an application where MVC would really help, and another where MVC wouldn't help.
B. What are the strengths and weaknesses of an object-oriented approach? Give me an example of a project where using OOA/D/P is the right idea, and an example where it's a bad idea.
C. What are the strengths and weaknesses of Squeak vs. Java? Give me an example where using Squeak is a good idea and one where it's a bad idea, and one where Java is a good idea and one where it's a bad idea.

Post comments, discussion, answers at Sum00 Final Exam Review: Tradeoffs


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 Sum00 Final Exam Review: Design Patterns


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

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 Sum00 Final Exam Review: Virtual Machines



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 Sum00 Final Exam Review: Design an Alarm System

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 implement View/Model communication? How would you change your Alarm class(es) to implement this feature? 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 Sum00 Final Exam Review: Displaying Alarm Status



Link to this Page