Question: (JAVA) 2) Write a class that will model a Dog. We are interested in developing an application that will keep track of every Dog in

(JAVA)

(JAVA) 2) Write a class that will model a Dog. We areinterested in developing an application that will keep track of every Dog

2) Write a class that will model a Dog. We are interested in developing an application that will keep track of every Dog in a certain locality. The properties of a Dog that needs to be captured in a Dog class are: name, weight and years, which could be defined as String, int and int respectively. Every Dog entered into the application will be modeled as a Dog object. These properties should be kept secure from tampering and hence, the class will need to encapsulate these properties. The client programs of the class will access and change these properties using appropriate getters and setters. The class should have a method called obtain Size that will return the size of the dog. Size is a string variable and can take the value of "small","medium", "large" (Size is not an instance variable). The method obtain Size will determine the size based on the following conditions. If the weight is

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!