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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started