Question: Java Programming II Homework 7 Create a ' Driver ' class to use your 'Farm' and 'Animal' classes and create instances of them. In the
Java Programming II Homework 7
Create a 'Driver' class to use your 'Farm' and 'Animal' classes and create instances of them.
In the main method do the following:
- Create a Farm of size 10
- Create 5 Animal Objects with the details specified in the table below
- Add the 5 Animal objects to the Farm
- Call the printDetails method from the Farm to print all the Farm and Animal details.
| variable name | name | birthYear | weight | gender |
|---|---|---|---|---|
| a1 | cow | 2012 | 1000.5 | f |
| a2 | pig | 2009 | 550.5 | m |
| a3 | donkey | 1999 | 773.42 | m |
| a4 | sheep | 2016 | 164.23 | f |
| a5 | goose | 2004 | 10.75 | f |




8.20 Homework 3-3 Create a Driver class to use your Farm and Animal classes and create instances of them. In the main method do the following Create a Farm of size 10 Create 5 Animal Objects with the details specified in the table below .Add the 5 Animal objects to the Farm .Call the printDetails method from the Farm to print all the Farm and Animal details ariable name name birthYear weight gender al a2 | a4 a5 cow 2012 1000.5 pig 2009 550.5 m donkey 1999 773.42m sheep 2016 164.23T goose 2004 10.75 LAB 0 16 ACTIVITY 8.20.1: Homework 3-3 Current file: Driver.java 8.20 Homework 3-3 Create a Driver class to use your Farm and Animal classes and create instances of them. In the main method do the following Create a Farm of size 10 Create 5 Animal Objects with the details specified in the table below . Add the S Animal objects to the Farm Call the printDetails method from the Farm to print all the Farm and Animal details. variable name name birthYear weight gender al a2 a4 a5 cow 2012 1000.5 pig 2009 550.5 m donkey 1999 773.42m sheep 2016 164.23f goose 2004 10.75 LAB ACTIVTY 8.20.1: Homework 3-3 0/16 Current file: Farm.java 8.20 Homework 3-3 Create a Driver class to use your Farm and Animal classes and create instances of them. In the main method do the following Create a Farm of size 10 Create 5 Animal Objects with the details specified in the table below . .Add the 5 Animal objects to the Farm Call the printDetails method from the Farm to print all the Farm and Animal details variable name name birthYear weight gender cow 2012 1000.5 pig donkey 1999 77342 m 2009 550.5 m a4 sheep201664.23T goose 2004 10.75 LAB ACTIVITY 8.20.1: Homework 3-3 0/16 Current file: Animal.java Current file: Animal.java Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box Develop mode Submit moden Enter program input (optional) If your code requires input values, provide them here Driver javaOutput (shown below) (Your program) Run program nput (from above) Program output displayed here Trouble with lab
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
