0

plz help me good people solve this problem and look in answers for the question.

public class Production { int years,days; int no_cows; double cow_in_heat; double heatFertile; double cowServed; public Production(int days,int years,int no_cows ,double cow_in_heat,double heatFertile,double cowServed){ this.days=days; this.no_cows = no_cows; this.years = years; this.cow_in_heat = cow_in_heat; this.heatFertile=heatFertile; this.cowServed=cowServed; } public void cowsInHeat(int no_cows){ cow_in_heat= no_cows* 0.9 ; System.out.println("there are " + cow_in_heat +"\t cows in heat "); } public void HeatsFertile(){ heatFertile = 0.9 * cow_in_heat ; System.out.println(heatFertile); } public void pregnant(){ cowServed=0.95 * heatFertile; double bull= 0.3 * cowServed; System.out.println("there are : "+cowServed+"\t cows that are pregnant"); System.out.println("there will be : " +bull +"\t bulls"); } public void gestation(int days){ if (days==287) System.out.println(" it's a Bull"); else if (days ==279) System.out.println("it's a heifer"); } public static void main(String[] args) { Scanner input=new Scanner(System.in); int days =0; double bull= 0; Production Production =new Production(00,00,00,0.0,0.0,0.0); Production.cowsInHeat(100); Production.HeatsFertile(); Production.pregnant(); Production. gestation(287); } }

27th May 2021, 12:45 AM
Masithembe Dyosi
Masithembe Dyosi - avatar
2 Respuestas
+ 1
Hello there, Sorry I didn't come with a solution but rather a suggestion. You can save that code in SoloLearn, and share the code link instead. That way the Description can be used to describe the problem, no need to write the Description in answers. https://www.sololearn.com/post/75089/?ref=app Good luck!
27th May 2021, 3:56 AM
Ipang
0
(a) Create a class named LivestockProject with fields that hold a membership number, the name of the member, surname, date of birth, gender, location and initial number of livestock (cattle) turned in. Include a constructor that initializes each field to appropriate default values. Also include methods to set and get each of the fields. (b) Create a livestock production estimation method(s) that will calculate and predict livestock production over a certain period of time (1 year, 2 years, 5 years, etc.), considering the following factors: • The percentage of cows in heat in a 21-day period = 90% • The percentage of the heats that are fertile = 90% • The percentage of the cows that are serviced by the bull = 95% • The 2 bulls per 100 cows ratio for a period of 5 years • The percentage of calves born in the herd will be bull = 30% • The gestation length of a bull valves = 287 days • The gestation length of a heifer valves = 279 days • The number of days a cow should undergo involution = 50 days • The number of births a cow can give in its lifetime = 8 • The age that a heifer requires to reach puberty and be bred = 14 months (c) Create a class named PredictProduction whose main() method instantiate an object of the class LivestockProject. Within the method, prompt a user for registration, indicating the name, surname, date of birth, gender, location and initial number of livestock (cattle) to turn in. When a certain number of members have been successfully registered, your application must print the following: • The Database of registered members on the application • Estimated livestock production per member over a certain period of time • Estimated livestock production for the entire project over a certain period of time • Estimated livestock production of bulls and heifers per member over a certain period of time • Estimated livestock production of bulls and heifers for the entire project over a certain period of time
27th May 2021, 12:59 AM
Masithembe Dyosi
Masithembe Dyosi - avatar