Midterm Exam
Midterm Exam
Faculty
of
Arts
and
Science
University
of
Toronto
Midterm
Test
Department:
Computer
Science
Instructor:
Matt
Medland
Date
&
Time:
10:10
am
-‐
Tuesday,
Feb
26,
2013
Conditions:
Closed
Book
Duration:
50
minutes
This
test
counts
for
15%
of
your
final
grade
Name:
___________________________________________________________
(Please
underline
last
name)
Student
Number:
_________________________________________________
Question
Marks
1
________________
/25
2
________________
/25
3
________________
/10
4
________________
/10
Total
____________
/70
=
____________
%
CSC302
Engineering
Large
Software
Systems
page
2/14
(c)
[UML
Class
Diagram
Elements
–
10
marks]
Identify
as
many
of
the
items
from
the
list
in
the
UML
class
diagram.
Marks
will
be
awarded
for
correct
identification,
and
subtracted
for
incorrect
answers.
Not
all
elements
in
the
list
appear
in
the
diagram.
Class
Diagram
Elements
• generalization
• composition
• public
attribute
• object
return
type
• aggregation
• public
operation
• private
attribute
• exception
• multiplicity
• private
operation
• class
name
• visibility
modifier
• realization
• stereotype
• primitive
attribute
• protected
operation
• dependency
:automobile
-‐make:String
-‐model:String
-‐year:int
:headlight
-‐colour:Colour
0..1
2
#startEngine():bool
...
#turnOff():void
+getYear():int
+getColour:Colour
:sedan
numDoors
getNumDoors()
CSC302
Engineering
Large
Software
Systems
page
4/14
For
this
question,
you
are
to
draw
a
sequence
diagram
for
the
Iterator
pattern.
The
class
diagram
for
Iterator
is
shown
in
Figure
3
below.
Use
page
7
(and
the
scratch
paper
at
the
back
of
this
package,
if
necessary)
to
draw
a
UML
Sequence
diagram
representing
the
Iterator
pattern.
Hints:
• you
do
not
need
abstract
classes
or
interfaces
in
your
diagram
• you
will
need
at
least
one
interaction
frame
• there
is
one
message
to
which
you
can
apply
a
stereotype
(b)
[Use
Case
Diagrams
–
10
marks]
Draw
a
UML
Use
Case
diagram
for
the
detailed
use
case
discussed
in
lecture
below.
Use
page
9
(and
the
scratch
paper
at
the
back
of
this
package,
if
necessary)
to
draw
the
Use
Case
Diagram.
Use
Case
–
Buy
a
Product
1. Customer
browses
catalog
&
selects
items
to
buy
2. Customer
goes
to
check
out
3. Customer
fills
in
shipping
information
(address,
next-‐day
or
3-‐day
delivery)
4. System
presents
full
pricing
information
5. Customer
fills
in
credit
card
information
6. System
authorizes
purchase
7. System
confirms
sale
immediately
8. System
sends
confirming
email
to
customer
CSC302
Engineering
Large
Software
Systems
page
9/14
[scratch
paper]
CSC302
Engineering
Large
Software
Systems
page
13/14
[scratch
paper]
CSC302
Engineering
Large
Software
Systems
page
14/14
[scratch
paper]