CS 117: Introduction to Computer Science, Fall 2001
Assignment 1: Object-Oriented Thinking

Assigned on Wednesday, 9/12/01.
Due on Monday, 9/17/01, at the beginning of class.

Plese turn in your answers to the following tasks on paper.

1. Suppose that you wish to model doing laundry. After all, laundry needs all the excitement it can get! Give a name and a short description (approx. 1 sentence) for at least four classes that would be useful. Choose one of these classes, and provide more detail. Draw a class/object diagram for it that contains both properties (variables) and methods. Describe briefly each property and method (approx. 1 sentence), and make sure that in the diagram and description you make it clear which ones are class members and which ones are object members. Make sure to include at least one class property, one class method, one object property, and one object method. In the diagram, instantiate at least two objects from the class.

2. Show an object-oriented model for a simple coffee vending machine. The front of the machine has four buttons, a coin slot, a coin return lever, and a dispensing window. The four buttons dispense four products: black coffee, coffee with cream, coffee with sugar, coffee with cream and sugar. Coffee costs $.35. Provide a class/object diagram and a description in words of your classes, properties, and methods.