Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I worked the problem but I am having trouble with the vector of barges. Could you please explain step by step how you arrive at

I worked the problem but I am having trouble with the vector of barges. Could you please explain step by step how you arrive at the solution. I want to understand this!

Part 2: The next class is called Barge, which contains the data a private data member of type vector a private data member of type string called name. Each barge has the following methods. A public constructor that has the name of the barge as a string. The constructor will assign the name of the barge to the data member, such as this->name=newName; A public member function called LoadFirework that takes a Firework * pointer as a parameter. o Inside this function, the Firework pointer is added to the barge. What you need to remember is that a vector of Firework Pointers can contain fireworks, rockets, or flowers. A public member function called Ignite(). o Ignite reports the name of the barge to the screen. The output would be "Barge "<name<<" sets off its display!" o The Ignite function traverses the vector of firework pointers with a temp variable. The firework will then explode, that is, temp->Explode();

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

Unity From Zero To Proficiency Beginner A Step By Step Guide To Coding Your First Game

Authors: Patrick Felicia

1st Edition

1091872023, 978-1091872028

More Books

Students also viewed these Programming questions