Hi so Im very much stuck on this Ive created arrays and tried everything but my code just isnt working and help would be great. Also I have included my .txt file for testing I also used java code
Assignment Description The table below shows dog breeds with different abilities - herding, hunting, protecting, and detecting Each breed has a fixed set of abilities as is listed in the table with a Y Herding Hunting Breed Beagle German Shepherd Golden Retriever Rhodesian Ridgeback Protecting Detecting Specifications 1. Create a Java class called LastNameFirstNameAssignment3 2. Follow "CS1450 Programming Assignments Policy" 3. Write a test program (i.e. main) that performs the following steps a. Creates a polymorphic array that will store dog objects b. Creates dog objects from the data provided in the test file dogs.txt C. Places each dog into the array d. AFTER all dog objects are in the array, perform these 3 tasks on the array of dogs: i. Find which dogs are the hunters ii. Find which dogs can herd, protect, and detect ii. Find the dog with the best hunting ability For tasks i and ii implement the following methods where each method Takes the array of all dogs and returns an ArrayList of dogs public static ArrayList
findHunters (Dog[] dogs) public static ArrayList findHerderProtectorDetector (Dog [] dogs) For task iii implement a method that returns the array index location of the best hunter public static int findBestHunter (Dog[] dogs) NOTE: be sure to place these 3 methods in the Assignment3 class e. Displays on the console the following for each method in step 3d (see output below) Dog's name Dog's breec Dog's ability (i.e. hunter, herder-protector-detector) Dog's temperament (use abstract temperament () method) Dog's numeric ability level (ONLY for findHerderProtectorDetector and findBestHunter methods) 4. Test file information: Run your code on the provided file dogs.txt This file is an example so DO NOT assume that your code should work for only 6 dogs in the order specified in the file a. b. Represents number of dogs in the file 6 gS Apollo 70 109 be Boomer 08 0 10 gr Rusty 0 1000 t Cebo 07 100 gr Mojo 0800 gs Dash 8 087 Details for each dog provided in the file eexplanation below 1st line is an integer value representing the number of dogs in the file Remaining lines contain details for each dog. The format is as follows: c. d. gs Apollo 7 0 10 9 Breed Name Herding Hunting Protecting Detecting Ability Aity Ability Ability Note: If herding-ability, hunting-ability, protecting-ability, or detecting-ability is zero then the dog does not have that ability (i.e., it's not part of its nature). For example e. German Shepherds are not hunters; so, their hunting ability is set to 0 Interfaces and Classes Herder, Hunter, Protector, and Detector Interfaces . Description Each interface represents a specific ability such as herding, hunting, protecting, etc . The specific ability is measured as a numeric value from 0 to 10 For example, Golden Retrievers are excellent hunters with hunting abilities of 10, 9, etc but not so good at protecting so their protecting ability is a 0 e Public Methods Herder interface has a method named herd() Hunter interface has a method named hunt() Protector interface has a method named protect() Detector interface has a method named detect() Returns integer value representing ability to herd Returns integer value representing ability to hunt Returns integer value representing ability to protect Returns integer value representing ability to detect drugs, seizures, etc. " " " Dog Class . Description ABSTRACT class that represents a generic dog Superclass in the hierarchy . Private Data Fields name - String for dog's name breed - String for dog's specific breed (i.e. Beagle, German Shepherd, etc.) . Public Methods Getter and setter for each data field ABSTRACT method temperament) - returns string describing the dog's nature Beagle, German Shepherd, Rhodesian Ridgeback, and Golden Retriever Subclasses Description o Each represents a specific dog - these are the subclasses in the hierarchy. o Each must extend Dog. o Each must implement the interfaces for the dog's specific abilities Private Data Fields o Instance variables for each ability the specific breed (subclass) is known for. . Public Methods Constructors Will take only values for the abilities that dog is known for. Example: Beagle constructor takes: name, huntingAbility and detectingAbility public Beagle (String name, int huntingAbility, int detectingAbility) A subclass must implement ONLY the interfaces for the abilities the dog is known for. Example: Beagle class only implements Hunter and Detector. This means Beagle must override the hunt() and detect() interface methods Each subclass must override the temperament() method in the abstract Dog class. Use the following strings for each breed's temperament. Breed BeagleI'm a friendly, curious and happy-go-lucky dog. I make an excellent hunting dog! German I'm confident, courageous and smart! l'm a gentle family pet and steadfast Temperament Shepherdguardian GoldenI'm friendly, intelligent and devoted! I won't provide much protection beyond Retriever licking an intruder to death! With my soft mouth I can even pick up eggs RhodesianI'm affectionate, dignified, and even-tempered! I'm called the Naval Seal of dogs! Ridgeback I'm an ancient breed developed in South Africa to track and keep at bay lions! gs Apollo 7 0 10 9 be Boomer0 80 10 gr Rusty 0 10 0 0 rr Cebo 0 7 10 0 gr Mojo 080 0 gs Dash 8 0 8 7