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 Darth (formerly Jill) decides to change her dog Lancelot into a show dog. Write a statement that accomplishes this in the main method in the DogTester class: public class DogTester { public static void main (String[] arg) { DogOwner jill; Dog d = new Dog(\"Hotdog\", \"poodle\", 15.0, true); jill = new DogOwner(\"Jill\", d); Dog c = new Dog(\"Chuckles\", \"spaniel\", 8.0, false); jill.setDog(c); jill.setName(\"Darth\"); jill.getDog().setName(\"Lancelot\");

Solution

Hi friend you have not posted Dog.java so, I do not have idea about method name that set dog as show dog:

public class DogTester {
   public static void main (String[] arg) {
       DogOwner jill;
       Dog d = new Dog(\"Hotdog\", \"poodle\", 15.0, true);
       jill = new DogOwner(\"Jill\", d);
       Dog c = new Dog(\"Chuckles\", \"spaniel\", 8.0, false);
       jill.setDog(c);
       jill.setName(\"Darth\");
       jill.getDog().setName(\"Lancelot\");

       // TODO: you have not posted DOG class so, do not have idea about method name,
       // please replace setXXX method to actual method
       jill.getDog().setXXX(\"ShowDog\")

   }
}

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