Question: I have to build a class called Pet.java and follow the instructions on the UML Class Diagram. However, I am not sure how to read

I have to build a class called Pet.java and follow the instructions on the UML Class Diagram. However, I am not sure how to read it as the public methods are different from the private ones in this class. For example, in the diagram it calls for private helpers such as:

-petType:String

-petName:String

-petAge:int

-dogSpace:int

-catSpace:int

-daysStay:int

-amountDue:Double

Also calls for public member methods such as:

+checkIn(int, string)

+checkOut()

+getPet(string, string, int)

+createPet(string, string, int)

+updatePet(string, string, int)

I know how to use the private helpers, but am unsure how to use the public member methods when they are different from the private helpers. My professor says to create getters and setters for them, but I get errors because the private portions do not match the public ones in the Pet class I am creating. I am also unsure of how to integrate the (string, string, int) into each of the public ones. Can you help me understand all this?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!