Question: 1) Define a class called Flower This class represents objects that can bloom. It should define the following functions: int get_num_flower() returns an integer representing

1) Define a class called Flower This class represents objects that can bloom. It should define the following functions: int get_num_flower() returns an integer representing the total number of flowers the Flower object has produced in its lifetime. bloom() causes the Flower to produce a certain number of flowers. There is no general implementation of this functions. Each child class will define their own implementation of bloom(). You are responsible for deciding the member variables for this class and appropriate access specifiers for the member variables and functions. 2) Create another class, Rose, which is a type of flower. A rose implements a bloom() function that causes the Rose to produce another 5 flowers. 3) Create a main function that demonstrates polymorphism of a Rose object. Note: marks will be allocated for this question based on how well you make use of inheritance to minimize the amount of new code which is written and OO design skills, just getting working code will not necessarily result in a pass mark for this
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
