CS 4604 Homework #1
Date Assigned: September 4, 2002
Date Due: September 11, 2002, in class, before class starts
- (8 points) It is possible for a many-one relationship to be symmetric.
Carefully state the conditions under which this can happen.
- (10 points) Readup Chapter 4 upto and including
Section 4.2.8 of your textbook and
answer Exercise 4.2.6. After completing parts (a)-(c),
perform the following additional
modification without introducing any new classes:
(d) Each ship assigned to a task group is given a priority (for that
task group). The ship with the highest priority is always given a 1 (for
that task group) and the numbers increase in steps of 1. Ships may thus
get different priorities for different task groups they are part of. But
the ships do not conversely assign any priority for the task groups
they are part of (they don't care!).
For full credit, include the final ODL code containing all four modifications.
- (12 points) Express the E/R diagram of Fig. 2.7 in ODL.
- (20 points; From the Spring 2000 Final)
Design an E/R diagram for the following situation:
Doctors prescribe drugs for patients. A given doctor can prescribe
many drugs for a certain patient. A patient may be treated by many
doctors and can be prescribed the same drug by different doctors.
Drugs can only be purchased by presenting prescriptions to the
pharmacist. A prescription can involve more than one patient (e.g.,
a mother and her baby), more than one drug, but is associated with
a unique doctor. If there are parts of the problem that cannot be modeled,
state these in the margin of your diagram (as "Notes").