14,984,271 members
See more:
(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

What I have tried:

Java
```import java.util.Scanner;

public class Production {

int birth_cow;
int cow_involution ;
int years,days;
int no_of_cows;
double cow_heat;
double heat_Fertile;
double cow_served_bulls;
private String cow_served_bull;

public Production(int days, int years, int no_of_cows, double cow_heat, double heat_Fertile, double cow_served_bulls){
this.days=days;
this.no_of_cows = no_of_cows;
this.years = years;
this.cow_heat = cow_heat;
this.heat_Fertile=heat_Fertile;
this.cow_served_bulls=cow_served_bulls;
}

public void cows_Heat(int no_cows){
cow_heat= no_cows* 0.9 ;
System.out.println("there are " + cow_heat +"\t  cows in heat ");
}

public void Heats_Fertile(){
heat_Fertile = 0.9 * cow_heat  ;
System.out.println(heat_Fertile);
}

public void served(){
cow_served_bulls=0.95 * heat_Fertile;
double bull= 0.3 * cow_served_bulls;
System.out.println("The percentage of of the cows that are serviced by the bull:"+cow_served_bull ) ;
System.out.println(bull +"there will be  : " +"\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;
int  bull= 0;

Production Production =new Production(00,00,00,0.0,0.0,0.0);

Production.cows_Heat(100);
Production.Heats_Fertile();
Production.served();
Production.gestation(287);
}
}```
Posted
Updated 26-May-21 19:28pm
v2
Richard MacCutchan 27-May-21 3:34am

Do you have a question?

## Solution 1

You are on the right track for your task but you must work out all details.
Learn to use the debugger to find the problems and implement all subtasks.

tips:
- take the time to visit some Java tutorial to learn the basics from a pro
- seperate items in classes and tasks in functions (and also in own files)
- make a lot of print at first (and remove when done)
- search the internet for tips