Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE WRITE CODE IN JAVA... THANK YOU! Write the following classes as per the UML design : Dog, DogLicense , Owner and DOB. Then, write

PLEASE WRITE CODE IN JAVA... THANK YOU!

image text in transcribed

Write the following classes as per the UML design : Dog, DogLicense , Owner and DOB.

Then, write a TestDog class that does the following :

Create a default Dog object dog1.

Obtain and set the values of instance variable name by using the respective setter.

Create the component object of the type Owner. To do this get the values of the owners 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 dog1 object.

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 dog1 object.

Follow the procedure similar to what is described in step e). Obtain the values of instance variables from the user, for the DogLicense object. Create the DogLicense object and use this object as the parameter of the setDogLicense method for dog1 object.

Call the printDogInfo() method for dog1.

Create a full-arg Dog object dog2. Use the same user values that you obtained in steps d), e) , f) and g). You do not need to obtain these values again from the user.

Call the printDogInfo() method for emp2, to print out all these values.

Dog -name-String -license:DogLicense -owner:Owner -dob:DOB +Dog() +Dog(String, Doglicense, Owner,DOB) +getName()-String +getLicense():DogLicense +getDob[:DOB +setName(string):void +setLicense(Doglicense) void +setOwner(owner):void +setDob(DOB):void +printDoginfo():void DOB Owner DogLicense -ownerName:String -ownerSSN:int -ownerphone:int +Ownerl) +Owner(string, int, int) +getownerName:String +getownersSN()-int +getownerphone()int +SetOwnerName(String]:void +SetOwnerssNint) void +setOwnerPhone(int):void -date int -month int -year int +DOB) +DOB(int,int,int) +getDate()int +get Month() int +getYear()-int +setDate(int):void +setYear(int):void +setMonth(int):void -licenseNum.int -licenseYear:int -licenseAuthority String +DogLicense(int int, String) +getLicenseNum()int +getLicenseYear)-int +getlicenseAuthority()-String +createLicenseNum(int):void

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Programming Languages 12th International Symposium Dbpl 2009 Lyon France August 2009 Proceedings Lncs 5708

Authors: Philippa Gardner ,Floris Geerts

2009th Edition

3642037925, 978-3642037924

More Books

Students also viewed these Databases questions

Question

please dont use chat gpt AI 7 3 0

Answered: 1 week ago