Hi so I ama having a pretty hard time doing this can anyone help? Guidance in the right path would help.
Also im doing this in java and the last picture is the .txt file i am using for test
1. 2. Create a Java class called LastNameFirstNameAssignment3 Follow "CS1450 Programming Assignments Policy" 3. Write a test program (i.e. main) that performs the following steps a. b. c. d. Creates a polymorphic array that will store dog objects. Creates dog objects from the data provided in the test file dogs.txt Places each dog into the array. AFTER all dog objects are in the array, perform these 3 tasks on the array of dogs: i. ii. iii. Find which dogs are the hunters Find which dogs can herd, protect, and detect 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 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 breed 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: a. Run your code on the provided file dogs.txt b. 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. Represents number of dogs in the file 6 gS Apollo 70 10 9 be Boomer 0 8 010 gr Rusty 0 1000 rr Cebo 0 7100 gr Mojo 0800 gs Dash 8087 Details for each dog provided in the file see explanation below C. d. 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: gs Apollo 7 0 10 9 Breed Name Herding Hunting Protecting Detecting Ability Ability Ability Ability e. Note: If herding-ability, hunting-ability, protecting-ability, or detecting-ability is zerdo then the dog does not have that ability (i.e., it's not part of its nature). For example: 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. . 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 o o Each represents a specific dog -these are the subclasses in the hierarchy. Each must extend Dog. 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. - This means Beagle must override the hunt() and detect() interface methods -Example: Beagle class only implements Hunter and Detector. 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! GermanI'm confident, courageous and smart! I'm a gentle family pet and steadfast 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! RidgebackI'm an ancient breed developed in South Africa to track and keep at bay lions! Temperament Tips Must Do . . Use an array to store the dogs you create from the information in the file. Use an ArrayList to return dogs from the methods. See step 3d. Do not assume the file provided is what the grader will use. It is important to learn to not make assumptions when writing code. For example, do not assume there are 6 dogs and do not assume the dogs will be in the order they are presented in the file. Output Your output will look like the following when running against the test file dogs.txt BEST HUNTING DOGS! Boomer is a Beagle and is a hunting dog I'm a friendly, curious and happy-go-lucky dog. I make an excellent hunting dog! Rusty is a Golden Retriever and is a hunting dog I'm friendly, intelligent and devoted! I won't provide much protection beyond licking the intruder to death! With my soft mouth I can even pick up eggs! Cebo is a Rhodesian Ridgeback and is a hunting dog I'm affectionate, dignified, and even-tempered! I'm called the Naval Seal of dogs! I'm an ancient breed developed in South Africa to track and keep at bay lions! Mojo is a Golden Retriever and is a hunting dog I'm friendly, intelligent and devoted! I won't provide much protection beyond licking the intruder to death! With my soft mouth I can even pick up eggs! HUNTING COMPETITION Hunting dogs get ready get set hunt! The winner is Rusty the Golden Retriever with a hunting ability of 10 I'm friendly, intelligent and devoted! I won't provide much protection beyond licking the intruder to death! With my soft mouth I can even pick up eggs! DOGS THAT HERD, PROTECT, and DETECT! Apollo is a German Shepherd and can herd, protect and detect! I'm confident, courageous and smart! I'm a gentle family pet and steadfast guardiarn Herding ability 7 Protecting ability 10 Detecting ability 9 Dash is a German Shepherd and can herd, protect and detect! I'm confident, courageous and smart! I'm a gentle family pet and steadfast guardian. Herding ability 8 Protecting ability 8 Detecting ability 7 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