Hello! Need help with my Java Homework Please use Eclipse and Add a comments in each program to explain what your code is doing so I can understand it and learn. I really appreciate the help! Examine carefully the UML class diagram Attached: NOTE: Class Reptile was missing a toString() method. It has now been added. class Pet has an attribute of type java.util.Date. no specific dates are required for this attribute. compareTo(Dog) compares Dogs by weight. Create executable class TestPet as follows: create at least one Reptile pet and display it create an array of at least four Dog pets sort the array of Dogs by weight use a foreach loop to fully display all data for all dogs sorted by weight (see sample output) Sample Output Reptile name = Slinky, rock python, M Must be caged, crawls or slithers Not much sound, maybe a hiss, acquired Fri Feb 03 17:06:54 EST 2017 All dogs sorted by weight Dog name = Pedro, chihuahua, M Walks on a leash, weight 14 Barks or howls, acquired Fri Feb 03 17:06:54 EST 2017 Dog name = Marley, pug, M Walks on a leash, weight 20 Barks or howls, acquired Fri Feb 03 17:06:54 EST 2017 Dog name = Sacha, beagle, F Walks on a leash, weight 25 Barks or howls, acquired Fri Feb 03 17:06:54 EST 2017 Dog name = Butch, Alsatian, M Walks on a leash, weight 90 Barks or howls, acquired Fri Feb 03 17:06:54 EST 2017 NOTE: The project should hold a total of 5 Java files.
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Hello! Need help with my Java Homework
Please use Eclipse and Add a comments in each
Examine carefully the UML class diagram Attached:
NOTE: Class Reptile was missing a toString() method. It has now been added.
- class Pet has an attribute of type java.util.Date.
- no specific dates are required for this attribute.
- compareTo(Dog) compares Dogs by weight.
Create executable class TestPet as follows:
- create at least one Reptile pet and display it
- create an array of at least four Dog pets
- sort the array of Dogs by weight
- use a foreach loop to fully display all data for all dogs sorted by weight (see sample output)
Sample Output
Trending now
This is a popular solution!
Step by step
Solved in 6 steps with 1 images