View the step-by-step solution to:

Question

I am currently trying to code a Java class for my In App Development course. In this assignment I have had to

create mutators, accessors, and at least one constructor . The problem I am experiencing is how to properly introduce a constructor and where I might begin.. class Pet

{

              // Define private (-) attributes for PET Class

              private String petType;

              private String petName;

              private int petAge;

              private double dogSpace;

              private double catSpace;

              private int daysStay;

              private double amountDue;

                             

              //Get and Set Methods for PetClass

              public String getPetType() {

                             return petType;

              }

              public void setPetType(String petType) {

                             this.petType = petType;

              }

              public String getPetName() {

                             return petName;

              }

              public void setPetName(String petName) {

                             this.petName = petName;

              }

              public int getPetAge() {

                             return petAge;

              }

              public void setPetAge(int petAge) {

                             this.petAge = petAge;

              }

              public double getDogSpace() {

                             return dogSpace;

              }

              public void setDogSpace(double dogSpace) {

                             this.dogSpace = dogSpace;

              }

              public double getCatSpace() {

                             return catSpace;

              }

              public void setCatSpace(double catSpace) {

                             this.catSpace = catSpace;

              }

              public int getDaysStay() {

                             return daysStay;

              }

              public void setDaysStay(int daysStay) {

                             this.daysStay = daysStay;

              }

              public double getAmountDue() {

                             return amountDue;

              }

              public void setAmountDue(double amountDue) {

                             this.amountDue = amountDue;

              }

              

              //Define the methods within the class attributes (+)

              

              public void checkIn() //Defines the check in variable

              {

              

              }

              

              public void checkOut() //Defines the check out variable

              {

                             

              }

              

              public Pet getPet()

              {

                             return this;

              }

              

              public void createPet()

              {

                             

              }

              

              public void updatePet()

              {

                             

              }

}



class Cat extends Pet

{

              public double catSpaceNbr;

Top Answer

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question