Question 1a Model of Work in this class
Draw a UML diagram of the following classes and associations. Do not show
any operations or attributes! Use the following class names: Student,
PieceOfWork, Date, SequenceNumber, TypeOfWork. Relationships: Each student
does several pieces of work. Each piece of work is done by one student on a
particular date. Each piece of work is of a particular type. Each piece of
work has a sequence number.
Question 1b
Add multiplicities and some role names to your diagram. Suggested role
names: does, doneBy, etc..
Answer: [ 05a.html ]
In the following work as a group of 4-6 people. When you have a solution (or 2) wait for a chance to present the diagrams to the class.
Question 2a Model of the Java 1.0 AWT Class Library
Draw a UML diagram of the following classes and relationships (Note. these
are taken from the Java library of classes): Integer and Float are
sub-types of Object. All Applets are Panels, all Panels are Containers, all
Containers are Components, and all Components are Objects. Some other
Components are Buttons, Lists, and TextFields.
Answer:
[ 05a.html ]
Question 2b
What do you add to the previous model
to show that:
Question 3a Compositions
Draw a UML diagram that uses composition (not attributes) to model the
following C++ class:
class Wodget { public: float size; int knobs; string id; };
Answer:
[ 05a.html ]
Question 3b
Draw a UML diagram that uses attributes (not composition) to model the C++
Wodget class above.
Answer: [ 05a.html ]
Question 4 Lab work/Web site
Draw a UML diagram of the part of your web site that is concerned with this
class. Include the following ideas: Your_Home_Page, Your_CS320_Page,
Lab_Page, Source_Code_Page.
Answer:
[ 05a.html ]
Question 5 LISP Data
Draw a UML diagram of a Node where: A Node is either Empty, an Atom, or a
Pair. Each Pair has two pointers to nodes called the car and cdr of the
Pair.
Answer: [ 05a.html ]
Question 6 Syntax and Semantics
Which diagram (1,2,3) matches best each XBNF definition (alpha, beta, gamma)
in this
[ 05xab.png ]
diagram.
Question 6a Syntax
For each syntax in
[ 05xab.png ]
give a string of "a"s and "b"s that fit that syntax and see if
it also fits the other two. Which syntax is most general -- every string
that fits the other two must also fit it.
Question 7 MiniCalc Syntax and Semantics
MiniCalc uses simple integer Expressions:
123
1+2
123
1+2
+
apply(left:Int, right:Int): Int
Draw a diagram, using the UML, that describes the classes of objects (Expression, Constant, Operation, Operator) plus their semantics. Do not show any syntax!
Answer: [ 05a.html ]
OO Classroom Activity
To Be Announced: Given the UML description of .... students are asked to
simulate various the objects collaborating.
Answers
[ 05a.html ]