Question
Overview UML class diagrams are useful tools for mapping out different classes for an object-oriented program. The UML class diagram displays the attributes and methods
Overview
UML class diagrams are useful tools for mapping out different classes for an object-oriented program. The UML class diagram displays the attributes and methods of each class as well as showing relationships between classes. In this activity, you will analyze a UML class diagram and implement either the Cat or the Dog class. The purpose of this activity is to give you practice interpreting a UML class diagram and implementing a class based on that diagram. Implementing classes based on a UML diagram is a valuable skill to help you work as a part of a development team. This assignment will also help prepare you to implement the Pet class as part of your Project One submission.
Prompt
For this assignment, you will select either the Cat or the Dog Java class from the UML diagram. Open the Virtual Lab (Apporto) by clicking on the link in the Virtual Lab Access module. Then open your Eclipse IDE and create a new class. Use the Eclipse IDE Tutorial Video if you need help with creating a class in Eclipse.
1. Before you begin, review the following UML Class Diagram, paying special attention to the attributes and behaviors of each class. As a note, though the diagram illustrates an inheritance relationship between the classes, the class you choose to implement does not have to
from the Pet class for the purposes of this assignment. You will learn more about implementing inheritance in later modules.
2.
Next, you will implement either the Cat or Dog Java class. Your class must meet all of the specifications from the UML Class diagram. Be sure to include the following in your Cat or Dog class:
All attributes (variables) with appropriate data types. Note that the types are not specified in this UML class diagram. You will need to think about what the most appropriate data type is for each attribute.
At least one constructor method that initializes values for all attributes
Accessors and mutators for all attributes. Each attribute should have a corresponding accessor (getter) and mutator (setter) method. These methods are indicated in the class diagram.
In-line comments and appropriate white space, according to the style guidelines you have learned so far in the course
Guidelines for Submission
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started