Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(Java) Complete the code for the class Dog by writing the required methods. The instance variables are as given in the incomplete code shown below.

(Java) Complete the code for the class Dog by writing the required methods. The instance variables are as given in the incomplete code shown below. The requirements are stated under the code below.

image text in transcribed

Requirements for the method findHumanYears : This method returns the dogs human years as an integer. This method takes in the instance variable, years, as the parameter. A human year is calculated as 7 times the (dog) years.

Requirements for the method findSize: This method returns the value of size as a string. This methods takes in the instance variable weight as a parameter. The size of the dog is calculated as follows: if weight is less than or equal to 20, the value of size is small or else, if the weight is less than or equal to 55, the size is medium, or else the size is large.

public class Dog private int weight: private int years: *Write the getters and setters for the instance variables/ variables /*Write the method findHumanYears/ /*Write the method findSize/

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part 3 Lnai 8726

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448440, 978-3662448441

More Books

Students also viewed these Databases questions

Question

Describe how we acquire language.

Answered: 1 week ago

Question

1. Identify three approaches to culture.

Answered: 1 week ago

Question

2. Define communication.

Answered: 1 week ago

Question

4. Describe how cultural values influence communication.

Answered: 1 week ago