Question: C++ programming, done in visual studio Create a class called SuperHero. The SuperHero class should have a default constructor(that prints Hero created and a destructor(that

C++ programming, done in visual studio

C++ programming, done in visual studio Create a class called SuperHero. The

Create a class called SuperHero. The SuperHero class should have a default constructor(that prints "Hero created" and a destructor(that prints a message saying the hero was defeated). Every Hero has a name member variable which is NOT public. Every Hero has member functions: saveTheDay(which prints "T'm here to save the day."), setName (which sets the name member variable) and getName Derive 2 classes from SuperHero: DCHero and MarvelHero. Both child classes inherit everything from the parent, but they all have their own version of the saveTheDay function(overriding the function). Both classes should have a constructor and destructor In main, create 3 objects and call the function to set their names; DCHero superMan; //feel free to substitute your favorite heroes here MarvelHero spiderMan; SuperHero wordGirl; Ask the user which Hero they would like to interview. this save function for that hero. Based on their answer, call void save(SuperHero& hero) { cout

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!