Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,5 @@
* `Integer getNumberOfPets()`
* `String getName()`
* `Pet[] getPets()`

hello
1 change: 1 addition & 0 deletions src/main/java/com/zipcodewilmington/assessment1/Cat.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class Cat extends Pet {
*/
public Cat(String name, Integer age) {


}

/**
Expand Down
19 changes: 16 additions & 3 deletions src/main/java/com/zipcodewilmington/assessment1/Pet.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,54 +8,67 @@ public abstract class Pet implements Animal {
* nullary constructor
* by default, pet has age of 0; name of "";
*/
private String name;
private Integer age;
private PetOwner owner;

public Pet() {
}

/**
* @param name name of this pet
*/
public Pet(String name) {
this.name="";
}


/**
* @param age age of this pet
*/
public Pet(int age) {
this.age=0;
}

/**
* @param name name of this pet
* @param age age of this pet
*/
public Pet(String name, int age) {
this.name="";
this.age=0;
}

/**
* @return name of this pet
*/
public String getName() {
return null;

return name;
}

/**
* @return age of this pet
*/
public Integer getAge() {
return null;
return age;
}

/**
* @param newPetOwner the new owner of this pet
* ensure this instance of `Pet` is added to the owner's composite `pets` list
*/
public void setOwner(PetOwner newPetOwner) {

this.owner = newPetOwner;
newPetOwner.addPet(this);

}

/**
* @return PetOwner object whose composite `pets` collection contains this Pet instance
*/
public PetOwner getOwner() {
return null;
return owner;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ public class PetOwner {
* @param name name of the owner of the Pet
* @param pets array of Pet object
*/
public PetOwner(String name, Pet... pets) {

public PetOwner(String name, Pet... pets)
{


}

/**
Expand Down