Instructions are attached. They should be everything that is needed. If there any questions please do not hesitate to ask
Polymorphism Introduction
Polymorphism just means that different objects can respond to the same message in different ways.
Polymorphism is a fancy name for a common idea. Someone who knows how to drive can get into and
drive most cars because they have a set of shared key characteristics – steering wheel, gear stick, pedals
for clutch, brake and accelerator, etc. – which the drivers knows how to use. There will be lots of
differences between the two cars, but you can think of them as subclasses of a superclass which defines
these crucial shared ‘operations’.
Assignment: In this assignment you will use the class diagram from the previous assignment. First
incorporate changes recommended from the previous assignment’s feedback. Introduce Polymorphism
where appropriate. Export your diagram as an image and submit it using the Assignment dropbox
below.
Checklist
Comment
Deduction
Improvement from Week 3 (Composition, Aggregation, Cardinality):
If you have both zooOrganizer and zoo classes, they have composition
Composition relationship. zooOrganzier owns zoo. Good.
zoo is parent of zooKeeper. zoo is also parent of animal. Good.
Aggregation
zooOrganizer and zoo are 1 to 1. zoo and zooKeeper are 1 to 1 or 1..*. zoo and
animal is 1 to 0..*. Good.
cardinality
Additional note: None.
Others
Tasks for Week 4 (Constructor):
There is at least one constructor for classes zoo, mammal, reptile, and bird. Well
done.
Constructor
one constructor in mammal, reptile, and bird should have the parameters
covering all attributes (its own and inheriting from animal class). Well done.
Parameters
Additional note: None.
Others
Total Deduction:
0
Your Score:
100
Note: Checklist and Comment in black are expectations. Comment in blue is feedback to meet expectations
public Vector
public Date
public tripOrganizer
Trip Organizer will be the user interface (UI).
It will be described more in the other areas
of the design. This is just a place holder.
public float
Vector is a Java
object. I needed
this so it would
appear in the
drop-down box
for method return
types
public person
public String name
public trip
public Vector reservations
public person organizer
public String theme
public Integer addHotelReservation
public Integer addRentalCarReservation
public Integer addAirplaneReservation
public void edithotelReservation
public void editRentalCarReservation
public void deleteReservation
public trip(String fileName)
public tripo
public void calculate Price
public reservation
public String confirmation Number
public String contractPhone Number
public void calculatePrice
public address
public hdtelReservation
public address address
public String roomType
public Date checkin
public Date checkOut
public hotelReservation(String line)
public hotelReservation(String confirmNum, String contNum. String rmType, Dateckin, Date ckOut, String str, String cty, String st, String zp)
public String toStringo
public float calculate Price
public void update HotelReservation(String confirmNum, String contNum, String rmType, Date ckln, Date ckOut, String str, String cty, String st, String zp)
public String street
public String city
public String state
public String zip
public airplaneReservation
public String source Airport
public String destination Airport
public Date flight Date
public airplaneReservation(String line)
public String to Stringo
public airplaneReservation(String confirm Num, String contNum, String aline, String Airport, String dAirport, Date fiDate)
public void update AirplaneReservation(String confirm Num, String contNum, String aline, String sAirport, String dAirport, Date Date)
public Integer airport Distance
public float calcualtePrice
public rentalCarReservation
public String make
public String model
public Date scheduledPickUp
public Date scheduledDropOff
public Date actualPickUp
public Date actualDropOff
public float window
public rentalCarReservation(String line)
public rentalCarReservation(String confirmNum, String contNum, String mak, String mod, Date sPickUp, Date sDropOff, Date aPickUp, String aDropOff, float wind)
public void update RentalCarReservation(String confirmNum, String contNum, String mak, String mod, Date sPickUp, Date sDropOff, Date aPickUp, Date aDropOff, float wind)
public String toStringo
public float calculatePrice