You are on page 1of 3

Software Engineering: Analysis and Design

ITECH 7201

Laboratory 5
Task 1
Consider the following class diagram

Consider the following declarations. Decide whether these declarations are legal or will cause a compiler
error message. Explain your answers. For each declaration, explain which is the type and which is the
object.

a) Emu emu = new Bird ( );


______________________________________________________________________________

______________________________________________________________________________

b) Predator fox = new Fox ( );

CRICOS Provider No. 00103D Insert file name here Page 1 of 3


______________________________________________________________________________

______________________________________________________________________________

c) Predator mammal = new Mammal ( );


______________________________________________________________________________

______________________________________________________________________________

d) Bird bird = new Eagle ( );


______________________________________________________________________________

______________________________________________________________________________

e) Animal animal = new Minnow ( );


______________________________________________________________________________

______________________________________________________________________________

f) Animal animal = new Animal ( ); // Note the class name on the CD is in italics
______________________________________________________________________________

______________________________________________________________________________

Practice a few more of these to make sure that you have got the idea.

2/ Consider the following declarations. What methods are available to each (ignore the Object
class)? Explain your answer.

a) Eagle eagle = new Eagle ( );

______________________________________________________________________________

______________________________________________________________________________

b) Bird bird = new Eagle ( );

CRICOS Provider No. 00103D Insert file name here Page 2 of 3


______________________________________________________________________________

______________________________________________________________________________

c) Bird bird2 = new Bird ( );

______________________________________________________________________________

______________________________________________________________________________

d) Predator pred = new Eagle ( );


(What will happen if you try to call move on pred? – e.g. pred.move( )).

______________________________________________________________________________

______________________________________________________________________________

Task 2

If you haven’t done so already, download the assignment one specifications from Moodle and start planning
how you will approach it. Set up an Enterprise Architect document and an Eclipse project for this assignment.

Read the assignment specifications very carefully. If there is anything you feel you would like explained more
carefully, let your lecturer/tutor know as soon as possible

CRICOS Provider No. 00103D Insert file name here Page 3 of 3

You might also like