Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Youve been hired to create a software system for the Awesome Animal Clinic! They would like to keep track of their animal patients. Here are

Youve been hired to create a software system for the Awesome Animal Clinic! They would like to keep track of their animal patients. Here are some attributes of the pets that they would like to track:

  • Name

  • Age

  • Weight

  • Type (dog, cat, lizard, etc.)

  • Breed

  1. Create a class that keeps track of the attributes above for pet records at the animal clinic. Decide what instance variables are needed and their data types. Make sure you use int, double, and String data types. Make the instance variables private.

  2. Create 2 constructors, one with no parameters and one with many parameters to initialize all the instance variables.

  3. Create Accessor (get) methods for each of the instance variables.

  4. Create a toString() method that returns all the information in a pet record.

  5. In the main method below, create 3 pet objects and call their constructors, accessor methods, and toString methods to test all of your methods.

  6. Make sure you use good commenting!

    Create a Pet class that keeps track of the name, age, weight, type of animal, and breed for records at an animal clinic.

    java

    I know some of it is filled out just do it all over. (avoid errors)

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
12345678910111213141516(**Petclass(completecomments)Cauthoresince/classPetf//keeptrackofthename,age,weight,typeofanimal,andbreedofthepetprivateStringname;privateintage;privatedoubleweight;privateStringtype;privateStringbreed;IIWrite2constructors,accessor(get)methods,andatostringmethod,Usegoodconmenting.Stringname=; CONSOLE SHELL Online (1) summer Ivey TesterClass.java public pet (String_name, int__age, double _weight, String_type, String_breed); 1 1) main method for testing public static void main(String[] args) \{ 1 Create 3 Pet objects and test all your methods Pet p= new Pet ("Shaggy", 23,0,, ); p. setBreed("German Shepherd"); p. setTypeofAnimal("Domestic dog"); p. setweight(28); System.out.print ln(p, toString()); System. out. println("Weight of pet: "+ p.getweight())

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2016 Riva Del Garda Italy September 19 23 2016 Proceedings Part 1 Lnai 9851

Authors: Paolo Frasconi ,Niels Landwehr ,Giuseppe Manco ,Jilles Vreeken

1st Edition

3319461273, 978-3319461274

More Books

Students also viewed these Databases questions

Question

In what areas of applying EI do I most need to improve?

Answered: 1 week ago