Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions