Question: java, do not chnage dog, cat and animal class. create store.java animal.java: dog.java cat.java interfcace: 51] Store Class 2 Class implements StoreOrganizer 2 Properly implements

java, do not chnage dog, cat and animal class. create store.java
 java, do not chnage dog, cat and animal class. create store.java
animal.java: dog.java cat.java interfcace: 51] Store Class 2 Class implements StoreOrganizer 2
animal.java:
Properly implements the StoreOrganizer interface 2] Big O is correct for the
dog.java
sort and search methods 3] Explanation for Big O is given and
cat.java
correct [4] Sorting method properly sorts the pets -[4 Search method returns
interfcace:
correct index [4] Add method properly adds a pet [10] Sort properly

51] Store Class 2 Class implements StoreOrganizer 2 Properly implements the StoreOrganizer interface 2] Big O is correct for the sort and search methods 3] Explanation for Big O is given and correct [4] Sorting method properly sorts the pets -[4 Search method returns correct index [4] Add method properly adds a pet [10] Sort properly uses bubble sort [10] 1inearSearch properly uses linear search 10] binarySearch properly uses binary search Proect Window Help Dog-java 1 public abstract class Animal implements ComparablecAnimal> t private int storeId; private String nane; private double price: blic Aninal(int storeid, String name, double price) this.storeid storeld; this.nane name; this.price price public Animal(int storeld) this.storeld storeld this.name"Buzz" this.price = 222.00; 8 public int getstoreld) t return storeld; 22 public void setStoreId(int storeId) t this.storeid = storeld; 26 public String getame) t return name; 3 public void setName(String nane) this name name; 31 public double getPrice) return price; 37 public void setPrice(double price) this.price price: 40 41 43 45 47 COverride public int compareTo(Aninal anial) ( if (storeld dog.getDroolRate)) 35 return 1 else it(tnis.getDroolRatel) cat.gethiceCaught()) 34 35 36 return 1i 37 else if(this.gethiceCaught) cat.gethiceCaught) return 1 39 return super.compareTolcat) 41 42 (Override 43 public String tostring) return "Store ID:+ getStoreld) ".Name:getNane) ", Price getPricel) Likes Lasagna: getLikesLasagna()+".Mice Caught:getMiceCaught)s 45 46 47 Gradescope Alpha Sigm Mail sshar Java, Do No. java Why public interface Storeorganizer f This method when implemented will return all of the animals in the store return all of the pets in the store s/ Animal[] getPetsO: This method should allow a user to add an animal to their store inventory . eparam a the animal to be added to the inventory void add (Animal a) This method should sort through the pets using bubble sort void sort This method should search through the pets to look for a specific " animal. This should use the binary search method eparam a the animal to search through the list * a return the index the animal is found or -1 if the animal is not found int binarySearch (Animal a) This method should search through the pets to look for a specific animal1. This method should use the linear search method eparam a the animal to look for @return the index the animal is found or -1 i found f the animal is not int linearSearch (Animal a)

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 Databases Questions!