Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please create these Java classes 0 puistel Q3) The figure on the next page shows the Animal, Plant classes and the Edible interface hierarchies. These

Please create these Java classes
image text in transcribed
image text in transcribed
image text in transcribed
0 puistel Q3) The figure on the next page shows the Animal, Plant classes and the Edible interface hierarchies. These classes are the parents of the classes described below: The Animal class is non abstract and defines two functions getlifespan )s getlheartRate), as shown in the figure above. The Plant class defines two abstract functions get.Nane ()&getGroup ().This class also defines one non abstract function isSeeded), as shown in the figure. The Animal class has two non-abstract child classes: Ant, and Shrimp. The Ant class defines a single function as in the figure, and has one child class, FireAnt. -The Plant class has two non-abstract child classes, Okra and Poisonlvy Interface Edible defines a single function as in the figure Interface Dangerous defines a single function as in the figure. Interface Poisonous is a child of Dangerous and defines a single function as in the figure. The classes Shrimp&Okra implement the Edible interface Class FirAnt implements the Dangerous interface, and class Poisonlvy implements the Polsonous interface. From the description above, complete the following 1- Using function and class names exactby as given in the description and figures above, create Java classes to design and represent this hierarchy. Place these files inside the Test 2 directory. Besides the files created for this test, there should be no other files of any type in theTest 2 directory 2 For each class, define two constructors: a default, no-argument constructor, and a constructor that assign values to all the member variables, including the variables defined in the class's parent, if any. 3- Adding getter and setter methods in addition to the ones in the figure is entirely optional; however you can only use constructors to assign values to class instance variables from your Driver.java test program 4- Use function return types exactly as given in the figure

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

Recommended Textbook for

Visual Basic6 Database Programming

Authors: John W. Fronckowiak, David J. Helda

1st Edition

0764532545, 978-0764532542

More Books

Students also viewed these Databases questions

Question

using signal flow graph

Answered: 1 week ago

Question

2. How will the team select a leader?

Answered: 1 week ago