For this assignment, you will select either the Cat or Dog Java class from the UML diagram provided in Project One and implement it. Open the Virtual Lab by clicking on the link in the Virtual Lab Access module. Then open your IDE and create a new class. Use the Eclipse IDE and Downloading Files From Eclipse tutorials to help you with this project. Review the UML Class Diagram, paying special attention to the class hierarchy, attributes, and behaviors. A text version of the UML Class diagram is available: UML Class Diagram Text Version. Next, implement either the Cat or Dog Java class in the IDE. Your class must meet all the specifications from the UML Class diagram. Be sure to include the following in your Cat or Dog class: All attributes with appropriate data structures The Cat and Dog classes both have their own attributes (instance variables). For example, the Cat class has the catSpaceNbr attribute. In addition to the dog- and cat-specific attributes, they both inherit from the Pet class. This means the Dog and Cat classes will also have the seven attributes from the Pet class.
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:
For this assignment, you will select either the Cat or Dog Java class from the UML diagram provided in Project One and implement it. Open the Virtual Lab by clicking on the link in the Virtual Lab Access module. Then open your IDE and create a new class. Use the Eclipse IDE and Downloading Files From Eclipse tutorials to help you with this project.
- Review the UML Class Diagram, paying special attention to the class hierarchy, attributes, and behaviors. A text version of the UML Class diagram is available: UML Class Diagram Text Version.
- Next, implement either the Cat or Dog Java class in the IDE. Your class must meet all the specifications from the UML Class diagram. Be sure to include the following in your Cat or Dog class:
- All attributes with appropriate data structures
- The Cat and Dog classes both have their own attributes (instance variables). For example, the Cat class has the catSpaceNbr attribute. In addition to the dog- and cat-specific attributes, they both inherit from the Pet class. This means the Dog and Cat classes will also have the seven attributes from the Pet class.
- At least one constructor method
- Accessors and mutators for all attributes
- Each attribute should have a corresponding “set” and “get” method. For example, there will be a getPetType() and setPetType() method for the petType attribute. Make sure to do this for all attributes.
- In-line comments and appropriate white space, according to the style guidelines you have learned so far in the course
- All attributes with appropriate data structures
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images