Question: Create a tester class called DogApplication (JAVA). In the DogApplication class , have a main method in which you will test the Dog and Dog

Create a tester class called DogApplication (JAVA). In the DogApplication class , have a main method in which you will test the Dog and Dog License objects one by one.

Create another Dog object dog1 using the overloaded constructors. Provide arguments of your choice, but make sure they are in the same order as you have specified in the constructors

Using getters, obtain dog1s name, weight and years and print out the details of dog1 on the output. Please make sure to include comments.

Create a DogLicense object called dog1License using the default constructor of DogLicense class.

Using the getter , obtain dog1s name and pass on this value ( the variable ) to set the name of dog1License object. To do this you will need use the getter to get dog1s name and save the return in a name variable. Then pass on this name variable to the setter of dog1Lcenses setName setter method.

Using the getter , obtain dog1s years. Subtract that value of dog1s years from 2018 and use the result to set the variable called licenseYear. For example if dogs years is 5, then license year is 2018-5 = 2013. Call the setter, (pass on the value of licenseYear ) for dog1License to set the value of its licenseYear instance variable.

Prompt the user to enter a 4 digit number and store this value in a variable called customID.

Call the method called CreateLicenseNum for dog1Liscense and pass on this method, the value ofcustomID.

Using getters obtain the values of all instance variables of dog1License and print them on the output with comments.

******************************************************************************

DogLicense.java:

public class DogLicense {

private int licenseYear;

private int licenseNum;

private String name;

// Default Constructor

public DogLicense()

{

licenseNum=100;

licenseYear=2001;

name = "Puppy";

}

//Overload Constructor

public DogLicense(int licenseNum, int licenseYear, String name)

{

this.name= name;

this.licenseYear= licenseYear;

this.licenseNum = licenseNum;

}

//Getters and setter methods

public void setName(String name) {

this.name = name;

}

public void setLicenseNum(int licenseNum) {

this.licenseNum = licenseNum;

}

public void setLicenseYear(int licenseYear) {

this.licenseYear = licenseYear;

}

public String getName() {

return name;

}

public int getLicenseNum() {

return licenseNum;

}

public int getLicenseYear() {

return licenseYear;

}

public void createLicenseNum(int customID)

{

licenseNum = (500*customID)+licenseYear;

}

@Override

public String toString() {

return "Dog Name: "+name+" Dog License Number: "+licenseNum+" Dog License Year: "+licenseYear;

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!