Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Dog - dogSpaceNumber - dogWeight - grooming + Dog + getGrooming() + setGrooming + getDogWeight() + setDogWeight) + getDogSpaceNumber() + setDogSpaceNumber() -petType -petName -petAge

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Dog - dogSpaceNumber - dogWeight - grooming + Dog + getGrooming() + setGrooming + getDogWeight() + setDogWeight) + getDogSpaceNumber() + setDogSpaceNumber() -petType -petName -petAge - dogSpaces - catSpaces - daysStay - amountDue + Pet() + getPetType() + setPetType() + getPetName() + setPetName() + getPetAge() + setPetAge() + getDogSpaces() + setDogSpaces() + getCatSpaces() + setCatSpaces() + getDaysStay() + setDaysStay() + getAmountDue + setAmountDue() -catSpaceNumber + Cat Cat + getCatSpaceNumber() + setCatSpaceNumber 1 import java.util.*; 2 class Dog extends Pet { 3 123456700 7 8 90 //declaring attributes of Dog public int dogSpaceNbr; public int dogweight; public String dogGrooming; //Constructor for Dog to initialize default values to the attributes public Dog(String petType, String petName, int petAge, int daysStay, int dogSpaceNbr,int dogweight, String dogGrooming){ 10 11 12 13 14 } 15 16 17 180 19 20 21 22 super(petType, petName, petAge, daysStay); this.dogSpaceNbr = dogSpaceNbr; this.dogweight = dogweight; this.dogGrooming = dogGrooming; Scanner read = new Scanner(System.in); //Scanner class to read input from reader. //code to get Grooming public void getGrooming () { } System.out.println("Dog Grooming "+dogGrooming); //code to set Grooming public void setGrooming () { 230 24 25 26 27 } 28 29 300 31 32 33 34 String temp = read.nextLine(); dogGrooming = temp; System.out.println("Dog Grooming "+dogGrooming); //code to get DogWeight public void getDogWeight() { } System.out.println("Dog Weight: "+dogWeight + kgs"); //code to set DogWeight 350 36 37 public void setDogWeight() { int temp = read.nextInt(); dogWeight = temp; System.out.println("Dog Weight : "+dogWeight + kgs"); // code to set DogSpaceNumber public void setdogSpaceNbr() { int temp = read.nextInt(); dogSpaceNbr = temp; 38 39 } 40 41 420 43 44 45 46 } 47 48 490 50 51 52 } 53 System.out.println("Dog SpaceNbr : "+dogSpaceNbr); // code to get DogSpaceNumber public void getdogSpaceNbr() { } System.out.println("Dog SpaceNbr: "+dogSpaceNbr); 54 public class MyPet 550 56 57 58 59 60 61 62 public static void main(String [ ] args) { //creating object to Dog class with details Type Name Age Stay SpaceNbr Weight Grooming Dog dog1 = new Dog("Dog", "Craze",4,2,10,6, "Yes"); // mutators dog1.getGrooming(); dog1.getDogWeight(); dog1.getdogSpaceNbr(); 63 64 65 } 234567890 Pet.java MyPet.java 1 import java.util.*; 2 class Pet { Scanner read = new Scanner(System.in); //Scanner class to read input from reader. //declaring attributes of Pet, dog and cat private String petType; private String petName; private int petAge; private int dogSpace; private int catSpace; private int amountDue; //public constructor public Pet(String petType, String petName, int petAge, int daysStay){ .9 10 private int daysStay; 11 12 13 14- 15 16 17 18 19 } 20 21 this.petType = petType; this.petName = petName; this.petAge = petAge; this.daysStay = daysStay;

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

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions

Question

27. Let . Show that if , then

Answered: 1 week ago