Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The files at the links below contain source code for three interrelated classes,

ID: 3600668 • Letter: T

Question

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 (Stringl 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"); /lend mairn Vend class CHECK ANSWER

Explanation / Answer

===========

for 1st

Dog d ---> First dog reference;

Dog c --> 2nd dog reference;

==

Now we have two dogs

==

Darth currently holding Dog with reference c [Chuckles ]

when she want to change the dog.

jill.setDog(d); //Answer

================================

now we are going to create a dog with the following variabes

HotDog

15kg

and we need to assign this to Dog d REFERENCE

========

Dog d = null;

d=new Dog("HotDog","poodle",15.0,true);//Answer

===========

Thanks

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote