Code in Java

class Pet is already given

//class Pet

public class Pet
{

private String name; //Pet's name
private String owner; //Pet's owner's (fur-parent's) name
private String birthday; //Pet's birthday in yyyy/mm/dd format: 2019/02/28
  
  
public Pet()
{
//NULL CONSTRUCTOR
}
  
//FULL CONSTRUCTOR
public Pet(String aName, String anOwner, String aBDay)
{
setName(aName);
setOwner(anOwner);
setBirthday(aBDay);
}
//END FULL CONSTRUCTOR
  
//Begin Set Methods
public final void setName(String aName)
{
name=aName;
}//end setName
public final void setOwner(String anOwner)
{
owner=anOwner;
}// end setOwner
public final void setBirthday(String aBDay)
{
birthday=aBDay;
}// end setBirtday
  
//End Set Methods
  
  
//Begin Get Methods
public final String getName()
{
return name;
}//end getName
  
public final String getOwner()
{
return owner;
}//end getOwner
  
public final String getBirthday()
{
return birthday;
}//end getBirthday
  
//END GET METHODS
  
//Begin toString
  
public String toString()
{
  
return String.format(“%s, whose parent is %s, was born on %s”,
getName(),
getOwner(),
getBirthday());
  
}
  
} Pet.java The only required change is to make the Pet class an abstract class. Do not make any other changes in Pet or the two subclasses. TestPetHierarchy.java Write a new test harness named Lab04.java to meet the following requirements: DO NOT include a Scanner object 1. 2. Code all processing in the main method. Declare an array to hold four (4) objects – two (2) Mammal objects and two (2) Reptile objects 3. Use a SINGLE array Name the single array myPets a. b. Instantiate the objects using the provided test data (included below). Write a SINGLE enhanced for loop to process the array objects. Expected output is included 4. 5. below. Test Data Please use the test data provided: Mammal”Bunny”, “Agnes” “2010/08/23”, “Dog” “2019/06/15” ) myPets[0] = new myPets[1] new Mammal “Lana”, “Liz”, “2015/03/23”, “Llama”, “2020/03/30” ); myPets [2] new Reptile( “Edgar”, “Kevin”, “2017/02/26” “Iguana” “Very warm, Damp, Sandy” ); new Reptile( “Diogenes” myPets[3] “Trudy” “1919/11/03”, “Galapagos Tortoise”, “Warm, Very large enclosure” ); Expected Output Bunny, whose owner is Agnes, was born on 2010/08/23. The Mammal is a(n) Dog. Next vaccinations due 2019/06/15. Lana, whose owner is Liz, was born on 2015/03/23. The Mammal is a(n) Llama. Next vaccinations due 2020/03/30. C Edgar, whose owner is Kevin, was born on 2017/02/26. The Reptile is a(n) Iguana. Its required environment is Very warm, Damp, Sandy. Diogenes, whose owner is Trudy, was born on 1919/11/03. The Reptile is a(n) Galapagos Tortoise. Its required environment is Warm, Very large enclos ure

"Get 15% discount on your first 3 orders with us"
Use the following coupon
"FIRST15"

Order Now