Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a UML diagram for a Cat class. Your cat has 3 attributes: name (i.e. Tobey) which is a String breed which is the type
Write a UML diagram for a Cat class.
Your cat has 3 attributes:
- name (i.e. Tobey) which is a String
- breed which is the type of cat it is (i. e. Himalayan Sealpoint), also a String
- gender which is a char (M is for Male, F is for female)
- age which is an int (i.e. 2)
Make sure you write the class name in the top box, the private data members in the second box, and the constructors along with the getters and setters in the last box. For the constructor, pass in the name, breed and gender as parameters. Make sure you have all the correct notation for the UML diagram. If you are having trouble, look at the rectangle example in the power point slides from Chapter 3.
UML Class Diagram for Cat
|
|
|
Step by Step Solution
★★★★★
3.46 Rating (156 Votes )
There are 3 Steps involved in it
Step: 1
Please find the below Cat and CatDemo classes CatDemo class has the main method to test the Cat clas...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