Question: Need help with this. Create a class to represent a Farm Object containing instances Of the Animal objects Farm View javadoc for Animal and Farm
Need help with this. 
Create a class to represent a Farm Object containing instances Of the Animal objects Farm View javadoc for Animal and Farm classes http://comet.lehman.cuny.edu/sfakhouri/teaching/cmp/cmp326/s19/hw/hw3/ animals : Animal [ farmName : String Farm( ) Farm( String) Farm( int) Farm( String, int) / (calculated controlled variable no setter / / default 10 animals //default 10 animals // size Of array addAnima1 ( An imal) : void necessary : String getFarmName( ) setFarmName(String) : void getAnima1 ( int) : Animal getNumAnima1s ( ) : int getFirstAnima1( ) : Animal getLastAnima1( ) : Animal getAnima1s( ) : Animal [ ] printA11Detai1s( ) : void be Low : / / use the next available slot to add the Animal, // return null If Index is invalid resize the array if // notice no this is a controlled variable // prints Farm attributes followed by Animal attributes as formatted // "FarmName: %20s I Number of Animals: I Farm Size: // "Name: *20s I Year Of Birth: I Weight: *10.2f I Gender: Nn" removeAnima1 ( int) : Animal removeA11Anima1s ( ) : void getTota1WeightOfAIIAnima1S ( ) : double getAverageWe1ghtOfA11Anima1s( ) : double getNumberOfAnima 1 sAb0veWe ight ( double ) . int getNumberOfAnima1 sBe IowWe ight ( double ) int increaseWeightOfA11Anima1s ( ) : void increaseWeightOfA11Anima1s (double) : void View javadoc for Animal and Farm classes http'.//comet.lehman.cuny.edu/sfakhouri/teaching/cmp/cmp326/s19/hw/hw3/ 8.19.1: Homework 3-2 Submission Instructions Additional files provided by your instructor. 0/40 Main . java Animal. java , and Farm . Java Download
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
