![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 19.01.2021 19:10 spowell4657
For this exercise, you are going to complete the Dog class. The structure has been set up for you, but you will need to complete two constructors (overloaded).
The first will take three parameters and assign the values to the instance variables. The method signature should take the name, then age, and finally weight.
The second constructor will only take name then age. For this one, you will assign a value of 0.0 to the dog’s weight.
Once complete, create and print two Dog objects in the DogTester class. The first should use three parameters and the second should only use two parameters.
Sample Output:
Name: Karel
Weight: 15.6
Age: 7
Name: Clover
Weight: 0.0
Age: 9
public class Dog
{
private String name;
private int age;
private double weight;
// Add your constructors here
public String toString(){
return "Name: " + name + "\nWeight: " + weight + "\nAge: " + age;
}
}
public class DogTester
{
public static void main(String[] args)
{
// Start here!
}
}
![ansver](/tpl/images/cats/User.png)
Answers: 3
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 04:00
Which spereadsheet type will determine how well a bussiness has done over the past year
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 15:30
What is a costume plot? why is it important to a film or theater production?
Answers: 2
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 09:30
Why is an outfitting a workspace with video games in a technology development company considered a strategic use of money
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 00:10
Read each statement below. if the statement describes a peer-to-peer network, put a p next to it. if the statement describes a server-based network, put an s next to it. p - peer-to-peer s - server-based
Answers: 1
You know the right answer?
For this exercise, you are going to complete the Dog class. The structure has been set up for you, b...
Questions
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/biologiya.png)
![question](/tpl/images/cats/es.png)
Spanish, 09.12.2020 22:50
![question](/tpl/images/cats/fr.png)
![question](/tpl/images/cats/health.png)
Health, 09.12.2020 22:50
![question](/tpl/images/cats/istoriya.png)
History, 09.12.2020 22:50
![question](/tpl/images/cats/himiya.png)
Chemistry, 09.12.2020 22:50
![question](/tpl/images/cats/mat.png)
Mathematics, 09.12.2020 22:50
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/istoriya.png)
History, 09.12.2020 22:50
![question](/tpl/images/cats/mkx.png)
Arts, 09.12.2020 22:50
![question](/tpl/images/cats/biologiya.png)
Biology, 09.12.2020 22:50
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/en.png)
English, 09.12.2020 22:50
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 09.12.2020 22:50
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/pravo.png)
![question](/tpl/images/cats/health.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 09.12.2020 22:50