Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in c++ please. Only the main.cpp file requires a code. 4.15 LAB: Plant information (vector) Given a base Plant class and a derived Flower class,
in c++ please. Only the main.cpp file requires a code.
4.15 LAB: Plant information (vector) Given a base Plant class and a derived Flower class, complete main to create a vector called myGarden The vector should be able to store objects that belong to the plant class of the Flower class. Create a function called Print Vector), that uses the Printinfo() functions defined in the respective classes and prints each element in myGarden. The program should read plants or flowers from input (ending with 1), adding each Plant or Flower to the myGarden vector and output each element in myGarden uting the Printinfo) function Ex If the input is plant spirea 10 flower Hydrangea 30 talne lilac flower Home 6 talne white plant Mint 4 -1 the output is Plant Information: Plant name: Spirea Cost: 10 Plant Information: Plant namet Hydrengea Contt 30 Annual: false Color of flowen Hilac the outputs Plant Information Plant name: Spirea Conts 10 Plant Information Plant names Hydrangea Costa Annual: false Color o losers Inc Plant Information Plant namet Rose Cost: Annual: false Color or lowers: white plant Information Plant Dame Mint Costi Load Current file: main.cpp 1 #include "Plant.h" 2 #include "Flower.h" 3 #include 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