Question: Create a C++ project, and all t Week 6-Abstract Parent Class. Now, let's realize the UML. class diagram (take the UML. class diagram to code
Create a C++ project, and all t Week 6-Abstract Parent Class. Now, let's realize the UML. class diagram (take the UML. class diagram to code Create a Pirate class using a separate header file and implementation file o Review your UML class diagram for the attributes and behaviors .The speak) method should be abstract because we do not know how a Pirate speaks until we know what kind of Pirate the object is. To make the method abstract, set the virtual method to 0 like this. virtual string speak() 0; pure virtual method abstract method Create a CaptainPirate class using a separate header file and implementation file. o The CaptainPirate class needs to inherit from the Pirate class o The speak() method should return a statement that you would expect from a CaptainPirate like this. return "Yaaarrr! It be a +pet+"InYaarrr Scallywags! Swab that poop deck!"; o The toString() method should return the Pirate toString) method plus a little more. For example: return Pirate: toString)+"pet: + pet; o Create a ZombiePirate class using a separate header and implementation file. . The ZombiePirate class needs to inherit from the Pirate class. . The speak) method should return a statement based on how hungry the ZombiePirate has become (reference the brainHunger). For example: string ZombiePirate: : speak (void) /I say sonething based on the hunger level switch (brainlunger) return "Yum. I just ate a brain
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
