The files at the links below contain source code for three i

The files at the links below contain source code for three interrelated classes, a Dog class, a DogOwner class, and a DogTester class that manipulates objects from the other two classes. DogTester.java DogOwner.java Dog.java Write a statement that creates a 15 kg showdog called \"Hotdog\" that\'s a poodle. Reference this dog using the Dog variable d. public class DogTester { public static void main (String[] arg) { Dog d = null;

Solution

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package chegg;

public class Dog {
  
private double weight;
private boolean show;
private String breed;
private String name;
  
public Dog()
{
weight = 0.0;
show = false;
breed = \"\";
name = \"\";
}
  
public Dog(String name,String breed,double weight,boolean show)
{
this.weight = weight;
this.breed = breed;
this.show = show;
this.name = name;
}
  
public void setWeight(double weight)
{
this.weight = weight;
}
  
public void setName(String name)
{
this.name = name;
}
  
public void setShow(boolean show)
{
this.show = show;
}
  
public void setBreed(String breed)
{
this.breed = breed;
}
  
  
}

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package chegg;


public class DogOwner {
private String name;
private Dog d;
  
public DogOwner()
{
name = \"\";
d = new Dog();
}
  
public DogOwner(String name,Dog d)
{
this.name = name;
this.d = d;
}
  
public Dog getDog()
{
return d;
}
  
public void setDog(Dog d)
{
this.d = d;
}
  
public void setName(String name)
{
this.name = name;
}
  
}

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package chegg;


public class DogTester {
public static void main (String[] arg)
{
Dog d = null;
d = new Dog(\"Hotdog\", \"poodle\", 15.0, true);
  
}
}

The files at the links below contain source code for three interrelated classes, a Dog class, a DogOwner class, and a DogTester class that manipulates objects f
The files at the links below contain source code for three interrelated classes, a Dog class, a DogOwner class, and a DogTester class that manipulates objects f

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site