Computer Science, asked by pavansai1nidadavolu, 7 months ago

Q.No.4. Design two classes, Dog and DogOwner. A dog needs to be taken for a walk if it had a drink more than 4 hours ago. The Class Dog has three methods: setDrinkTime(int), which allows the time of drinking to be specified as an integer; getDrinkTime(), which returns the time of drinking; and needsToGo(), which is true if the dog needs to be taken for a walk.

Your first task is to implement these methods. In order to do this, you will also have to create an instance variable which stores the time of drinking.

The second class is DogOwner:

Here, you need to implement the takeForWalk(Dog d) method, which returns the value true if dog needs to go, and false otherwise.

In order to test the interaction between the two classes, it's helpful to have a 'TestDrive' class with a main() method. We're going to refer to this as a 'Launcher'. The class name is DogWalkLauncher​

Answers

Answered by satheeshvinayakam
0

Answer:

vivo

Explanation:

don reach teeth eh do even dry dry the the red tan this

Similar questions