cs121-fall2010 - midterm

CS 121 - Fall 2010

The midterm period is now over. Samples answers are posted online.

instructions

This is a take home exam, to be completed at any time before the due date, but in no more than 75 minutes.

You must answer the questions by yourself, in your own words, within the time alloted for the exam. You can use class notes, readings, books, Google or any other non-human source of information.

The test comprises of 5 questions. Write your answers to each question in a plain text file whose name is: CS121-midterm-<yourfirstname>.txt

Write your full name and email address at the top of the file.

Answer each question with a short paragraph. Keep your answers short and to the point: only one to a few sentences unless indicated otherwise. Remember to indicate the question number for each answer.

Email your answer file to alex@cs.hmc.edu with subject CS 121 - midterm by the deadline. There will be no extension. A late submission will result in a grade of 0.

The midterm will be graded out of 100 points. Each question's total worth is indicated next to the question number.

Note: up to 5 points will be taken out for a file name that does not comply with these instructions (answer file name, email subject, etc.)

design

question 1 (10 pts)

The "Window-Icon-Menu-Pointing device" (WIMP) interface first developed in the early 70's at Xerox PARC, implements many established principles of design for usability, sometimes with great success, sometimes with unintended negative effects. Give 2 examples of positive aspects and why they work; give 2 examples of negative aspects and why or when they don't work as intended.

Hints: for positive, think WIMP vs. terminal command line interface; for negative, think beyond desktop business applications.

requirements

snow flake applet screenshot

The SnowFlake applet illustrates the concept of fractals by providing an interactive plot of the Koch snowflake. The interface shows the snowflake curve; a field that displays the current subdivision level, and in which the user can enter the subdivision level; and, two buttons, labeled "+" and "-" to increase or decrease the level. When the user clicks the buttons or enters a new subdivision level value, the graphics and data displayed are updated accordingly.

Left: screenshot of the SnowFlake Applet (click for larger size)

question 2 (25 pts)

Translate the informal description of the SnowFlake applet given above into a list of formal requirements. Group the requirements based on their type (FURPS+), and number them (for use in the next question).

Note: make your list as complete as possible based on the description provided, but do not make up requirements.

use cases

question 3 (20 pts)

The use case Increment subdivision level explores one interaction scenario with the system described above. Translate the scenario below into a use case (short narratives under headings), and then into a refined use case (atomic steps). Refer to the requirements you listed in your answer to the previous question.

Scenario: Increment subdivision level

The user presses the button labeled "+". The subdivision level is incremented by 1, as reflected in the display, and the Koch snowflake plot is redrawn at the new subdivision level. If the subdivision level is at its maximum value, nothing happens.

Use case (10/20 pts)

Refined use case (10/20 pts)

architecture and design

question 4 (20 pts)

A Koch snowflake is a closed curve that can be computed procedurally given a base polygon and a subdivision level. The base polygon can be represented by a collection of vertices. Each vertex has two coordinates.

The following UML class diagram illustrates two possible designs for a SnowFlake class.

uml class diagram

Two possible designs for class CSnowFlake (click for larger size)

Briefly describe the difference in design between class CSnowFlakeA and CSnowFlakeB. Explain which design is more appropriate (and why).

question 5 (25pts)

Write the C++ header file for the CSnowFlake class that implements the design you chose above. Do not provide implementation for member functions (only declarations in the class definition). Write the file name in a comment at the top. Document your code using the Doxygen syntax we have been using for the project.

Note: this code will not be checked with a compiler, typos will not be counted as errors - what matters is the intention...

Some potentially useful info:

---beginning of file---

// File name: 




---end of file---
arjf © 2010