Question: Week 6 Assignment Create a class called Dog and model a 'Has-a relationship between Dog and its component classes, as specified in the UML: Please

Week 6 Assignment Create a class called Dog and model a 'Has-a" relationship between Dog and its component classes, as specified in the UML: Please refer to video Module 2_12 that explains composition in class Dec DOB Degree 0 The classes with their instance variables, constructors, getters and setters are shown in the UML diagram. The printDoginfo() method prints all the instance variables of the Dog object and also the instance variables of its constituent DOB, DogLicense and Owner objects. a) Write the following classes as per the UML design: Dog, DogLicense, Owner and DOB. b) Then, write a TestDog class that does the following: c) Create a default Dog object dog1. d) Obtain and set the values of instance variable name by using the respective setter. e) Create the component object of the type Owner. To do this get the values of the owner's instance variables from the user. Use the full arg-constructor of Owner to create an object of this class. Use this newly created Owner object as the parameter of the setOwner method of the dog object 1) Follow the procedure as described in step e) to create the DOB object and use this object as the parameter of the setDob method for dog object. 9) Follow the procedure similar to what is described in step e). Obtain the values of instance variables from the user, for the Dog License object. Create the Dog License object and use this object as the parameter of the setDog License method for dog1 object h) Call the printDoginfo() method for dog1. 1) Create a full-arg Dog object dog2. Use the same user values that you obtained in steps d), e). 1) and g). You do not need to obtain these values again from the user. D) Call the printDogInfo() method for emp2, to print out all these values. Copy paste the code for each class here. Also submit all your source code files
Step by Step Solution
There are 3 Steps involved in it
Sure Lets write the classes as specified in the UML diagram and then create a TestDog class to test everything 1 Dog Class java public class Dog private String name private Owner owner private DOB dob ... View full answer
Get step-by-step solutions from verified subject matter experts
