Question: Suppose that the following classes have already been coded so you DONT need to write them: The Plant class has one instance variable called (English)

Suppose that the following classes have already been coded so you DONT need to write them: The Plant class has one instance variable called (English) name. Tree inherits from Plant and adds a height instance variable.

a) Write the code for a PlantFacts interface containing the following methods:

a method to return the botanical (Latin) name of the plant

a method that describes how the plant is used by humans (eg, as food, to build houses, etc)

b) Dont write any code just answer these questions:

i. what changes would you have to make to the Plant class so that it can use the PlantFacts interface?

ii. if the Plant class has been changed so that it can use the PlantFacts interface (as described above), what changes would you need to make to the Tree class?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!