A veterinary surgery wants to create a class for individual pets.
Some of the attributes required in the class are listed in the table.
Attribute | Data type | Description |
|---|---|---|
PetID | STRING | unique ID assigned at registration |
PetType | STRING | type of pet assigned at registration |
OwnerTelephone | STRING | telephone number of owner assigned at registration |
DateRegistered | DATE | date of registration |
State one reason why the attributes would be declared as PRIVATE.
Complete the class diagram for Pet, to include:
an attribute and data type for the name of the pet
an attribute and data type for the name of the owner
a method to create a Pet object and set attributes at the time of registration
a method to assign a pet ID
a method to assign the date of registration
a method to return the pet name
a method to return the owner’s telephone number.
Pet | |
|---|---|
PetID | : STRING |
PetType | : STRING |
OwnerTelephone | : STRING |
DateRegistered | : DATE |
...................................................................... | : ........................... : ........................... |
.......................................................................................................................................................................................................................................................................................................................................... | |
Did this page help you?