©2006 Felleisen, Proulx, et. al.


+-------------------+            
| Sensor            |            
+-------------------+            
| String instrument |
| Time t            |------------+           
| int value         |            |
+-------------------+            |
                                 v      
         +----------------------------+
         | ClockTime                  |
         +----------------------------+
         | int hour /* 24 hr clock */ |
         | int minute                 |
         | int second                 |
         +----------------------------+

Figure: A class diagram for sensor readings

1.5  Problem

Take a look at the data definition in figure 1.4.

Design the data definition in the Beginner HtDP language that represents the information for a sensor and provide data examples.

Translate the class diagram into a collection of Java classes. Translate the Beginner HtDP examples into Beginner ProfessorJ language. Solution

1.6  Problem (3.3)

Revise the data representation for the book store assistant in problem 1.2 so that the program keeps track of an author's year of birth and the author's name. Modify the class diagram, the class definition, and the examples. Solution

1.7  Writing Problem

Writing assignments are separate from the rest of the assignment for the week. You should work on this assignment alone, and submit your work individually on the due date for the rest of the homework. The answer should be about two paragraphs long -- not to exceed half a page or 300 words.

Find on the web statistics about some interesting aspect of computing. Describe one particular statistics, explain what it means, and why do you find it interesting. Include the URL for the site where you found this information. Solution