Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(JAVA) 5. Create a tester class called Dog Application in same package as you have create the Dog and DogLicense classes. In the DogApplication class,
(JAVA)
5. Create a tester class called Dog Application in same package as you have create the Dog and DogLicense classes. In the DogApplication class, have a main method in which you will test the Dog and Dog License objects one by one. a) Create another Dog object dog1 using the overloaded constructors. Provide arguments of your choice, but make sure they are in the same order as you have specified in the constructors b) Using getters, obtain dog1's name, weight and years and print out the details of dog1 on the output. Please make sure to include comments. c) Create a DogLisense object called dog1License using the default constructor of DogLicense class. d) Using the getter, obtain dog1's name and pass on this value ( the variable ) to set the name of dog1License object. To do this you will need use the getter to get dog1's name and save the return in a name variable. Then pass on this name variable to the setter of dog1Lcense's setName setter method. e) Using the getter, obtain dog's years. Subtract that value of dog's years from 2018 and use the result to set the variable called license Year. For example if dog's years is 5, then license year is 2018-5 - 2013. Call the setter, (pass on the value of license Year) for dog1License to set the value of its license Year instance variable. f) Prompt the user to enter a 4 digit number and store this value in a variable called customID g) Call the method called createLicenseNum for dog 1Liscense and pass on this method, the value of customID h) Using getters obtain the values of all instance variables of dog1 License and print them on the output with comments. Answer: copy/paste your code below. Also provide a screen shot of the results. The outputs should be formatted such that each out put line should describe what the output stands for. Dog DogLicense -name:String -weight:int -years:int +Dog() +Dog(String, int,int) +getName():String +getWeight():int +getYears():int +setName(String):void +setWeight(int):void +setYears(int):void +obtainSize():String -licenseNum:int -license Year:int -name:String +DogLicense() +DogLicense(int,int, String) +getLicenseNum():int +getLicense Year():int +getName():String +setLicense Year(int):void +setName(String):void +createLicenseNum(int):void
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