Simulating a Turkey FarmWe have two classes that are going to be created, TurkeyFarm.java and Turkey.java. A skeleton has been provided for Turkey. Provide implementations for the following methods:birth(). This method will set the current Turkey’s pregnancy status to false if not already false. isAdult(). This method returns true if age is over the adult age isPregnant(). This method returns true if pregnant. istimeToDie(). This method returns true if age is over the max age. getID(). This method returns the ID of the Turkey. getPairID(). This method returns the ID of the turkey it is paired with. unPair(). This method removes the current value for who it is paired with and sets it to 0. passTime(). This method will add to each of the day values. This includes the age and pregnancy. slaughter(). This method will increment a counter that keeps track of how many Turkeys have been slaughtered so far. isPaired(). This method returns true if the turkey’s pairID is not equal to zero. mate(Turkey t1, Turkey t2). This method will determine which of the two is female. Then it will make the female pregnant and set the days pregnant to 0. pair(Turkey t1, Turkey t2). This method will set the pairID of each turkey to the ID of the other. getGender(). This method returns the number for the gender, either 1 or 2. isPregnancyDue(). This method returns true if the daysPregnant is greater than Pregnancy duration.The constructor for the Turkey has not been implemented. It should include initialize all the variables for a single turkey as well as change any necessary static variables. Be sure to use the random number generator to randomly assign genders.Methods not written but need to be implemented. toString(). This method will return a string with all of the relevant information about a turkey. Static methods to Get & Print total number of Turkeys. Get & Print total number of adult Turkeys. Get & Print total number of not adult Turkeys. Get & Print total number of paired Turkeys Get & Print total number of not paired Turkeys The necessary variables and changes needed to make the above static methods work as required. Additional methods should be implemented as needed if they make the above methods easier to code.
Simulating a Turkey Farm
Plagiarism-free and delivered on time!
We are passionate about delivering quality essays.
Our writers know how to write on any topic and subject area while meeting all of your specific requirements.
Unlike most other services, we will do a free revision if you need us to make corrections even after delivery.
How it Works
Place an order
Fill out the order form.
Attach any custom instructions that is required to complete your order.
Pay online safely.
The order form will redirect you to a payment page.
Receive Order via Email
Once the order is complete, we’ll send it via the email provided on the order form.