You are given a template to help you follow the required structure. There are 10 files for the base and derived classes with specification and implementation files You are also given a driver MagicalCreaturesMain.cpp that you will complete. So 11 files in all. MagicalCreatureHeader.h  // given to you MagicalCreature.cpp  // given to you       ElfHeader.h     // given to you Elf.cpp            // you implement methods     DragonHeader.h    // given to you Dragon.cpp           // you implement methods   GoblinHeader.h   // given to you Goblin.cpp          // you implement methods   GenieHeader.h   // given to you Genie.cpp          // you implement methods Specifications: Here are five UML Diagrams: One for the Base class and the others for the derived classes. Use these along with the given template to complete the design of the classes and create the application. The template contains comments and notation as to where you need to fill in the code;                                                 Magical Creature (Base Class) -string name    //  name of the creature -string type      //  type of the creature -string color     //  color of the creature -int age           //  age of the creature   + MagicalCreature()  //default constructor that sets name, type,color to “null and age to 0 +MagicalCreature(string name, string type, string color, int age)   // regular constructor +getName(): string // returns the name – can be any fun name +getType: string // returns type (Can be “Dragon”, “Genie” , ”Goblin”, “Elf”) +getAge: int  // returns age. This should be a positive number +setAge(int age): void // can grow older or younger magically! +getColor() : string // returns any color +setColor(string color): void // can change color magically! +talk():string // returns creature speak +liveIn():string // return its natural habitat +toString(): String   // return the object description as  “Name: “ name  “Age:” age                                                                                                                                                  “Type:” type “Color:” balance                                                                                                                                                                                        Dragon derived from Magical Creatures -bool hasSpikes     //  color of the dragon -int size           //  weight in pounds of the dragon   + Dragon()  //default constructor that sets name, type,color to “null and age to 0 + Dragon(string name,string color,string type, int age, int size, bool hasSpike);  (string name, string type, string color, int age)   // regular constructor getSize(): int // get size changeSize(int newSize): void // grows big or small! getHasSpike(): bool //set to true setHasSpike(bool hasSpike) // set to true toString():string // returns “I am a Dragon, I breathe fire!”                                         Elf derived from Magical Creatures   -int size           //  weight in pounds of the dragon   + Elf()  //default constructor that sets name, type,color to “null and age to 0 + Elf(string name,string color,string type, int age);  (string name, string type, string color, int age)   // regular constructor +toString():string // returns “I am an Elf..I can spell”                                       Goblin  derived from Magical Creatures   + Goblin ()  //default constructor that sets name, type,color to “null and age to 0 + Goblin(string name, string color, string type, int age) // regular +talk():string // returns “I speak Gibberish”                                     Genie derived from Magical Creatures -bool hasWand     //  set to true -int size           //  weight in pounds of the genie     + Genie()  //default constructor that sets name, type,color to “null and age to 0  +Genie(string name, string color, string type, int age, int size, bool  +liveIn():string// return “I live in a bottle”   getSize(): int;   changeSize(int newSize): int   getHasWand(): bool   setHasWand(bool hasWand):void

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

You are given a template to help you follow the required structure. There are 10 files for the base and derived classes with specification and implementation files

You are also given a driver MagicalCreaturesMain.cpp that you will complete. So 11 files in all.

MagicalCreatureHeader.h  // given to you

MagicalCreature.cpp  // given to you

 

 

 

ElfHeader.h     // given to you

Elf.cpp            // you implement methods

 

 

DragonHeader.h    // given to you

Dragon.cpp           // you implement methods

 

GoblinHeader.h   // given to you

Goblin.cpp          // you implement methods

 

GenieHeader.h   // given to you

Genie.cpp          // you implement methods

Specifications:

Here are five UML Diagrams: One for the Base class and the others for the derived classes. Use these along with the given template to complete the design of the classes and create the application.

The template contains comments and notation as to where you need to fill in the code;

 

                                              Magical Creature (Base Class)

-string name    //  name of the creature

-string type      //  type of the creature

-string color     //  color of the creature

-int age           //  age of the creature

 

+ MagicalCreature()  //default constructor that sets name, type,color to “null and age to 0

+MagicalCreature(string name, string type, string color, int age)   // regular constructor

+getName(): string // returns the name – can be any fun name

+getType: string // returns type (Can be “Dragon”, “Genie” , ”Goblin”, “Elf”)

+getAge: int  // returns age. This should be a positive number

+setAge(int age): void // can grow older or younger magically!

+getColor() : string // returns any color

+setColor(string color): void // can change color magically!

+talk():string // returns creature speak

+liveIn():string // return its natural habitat

+toString(): String   // return the object description as

 “Name: “ name

 “Age:” age                                                                                                                                                  “Type:” type

“Color:” balance                                                                                                                                               

 

 

                                    Dragon derived from Magical Creatures

-bool hasSpikes     //  color of the dragon

-int size           //  weight in pounds of the dragon

 

+ Dragon()  //default constructor that sets name, type,color to “null and age to 0

+ Dragon(string name,string color,string type, int age, int size, bool hasSpike);

 (string name, string type, string color, int age)   // regular constructor

getSize(): int // get size

changeSize(int newSize): void // grows big or small!

getHasSpike(): bool //set to true

setHasSpike(bool hasSpike) // set to true

toString():string // returns “I am a Dragon, I breathe fire!”

 

 

                                    Elf derived from Magical Creatures

 

-int size           //  weight in pounds of the dragon

 

+ Elf()  //default constructor that sets name, type,color to “null and age to 0

+ Elf(string name,string color,string type, int age);

 (string name, string type, string color, int age)   // regular constructor

+toString():string // returns “I am an Elf..I can spell”

 

                                    Goblin  derived from Magical Creatures

 

+ Goblin ()  //default constructor that sets name, type,color to “null and age to 0

+ Goblin(string name, string color, string type, int age) // regular

+talk():string // returns “I speak Gibberish”

                                    Genie derived from Magical Creatures

-bool hasWand     //  set to true

-int size           //  weight in pounds of the genie

 

 

+ Genie()  //default constructor that sets name, type,color to “null and age to 0

 +Genie(string name, string color, string type, int age, int size, bool

 +liveIn():string// return “I live in a bottle”

  getSize(): int;

  changeSize(int newSize): int

  getHasWand(): bool

  setHasWand(bool hasWand):void

Printing Traits of each magical creature
Name: Jack
Type: Dragon
Color:black
Age: 200
Talk: Magical Creature is talking.
Live: Magical Creature lives anywhere.
To String: I am a Dragon! I breathe fire
Name: Jill
Type: Type: Dragon
Color: white
Age: 100
Magical Creature is talking.
Magical Creature lives anywhere.
To String: I am a Dragon! I breathe fire
Name: Doug
Type: Elf
Color:green
Age: 80
Talk: Magical Creature is talking.
Live: Magical Creature lives anywhere.
To String: I am an Elf.... I can spell
Name: Cosmo
Type: Genie
Color:blue
Age: 1000
Talk: Magical Creature is talking.
Live: I live in a bottle
To String: I am a Magical creature
Name
: Cosmo
Type
Color
Age
: Genie
: blue
: 1000
Name: Harry
Type: Goblin
Color:red
Age: 150
Talk: I talk Gibberish
Live: Magical Creature lives anywhere.
To String: I am a Magical creature
Name
: Harry
Type
: Goblin
Color
: red
Age
: 150
In display Dragons:
I amJack: I am a Dragon! I breathe fire
In display Dragons:
I amJill: I am a Dragon! I breathe fire
Transcribed Image Text:Printing Traits of each magical creature Name: Jack Type: Dragon Color:black Age: 200 Talk: Magical Creature is talking. Live: Magical Creature lives anywhere. To String: I am a Dragon! I breathe fire Name: Jill Type: Type: Dragon Color: white Age: 100 Magical Creature is talking. Magical Creature lives anywhere. To String: I am a Dragon! I breathe fire Name: Doug Type: Elf Color:green Age: 80 Talk: Magical Creature is talking. Live: Magical Creature lives anywhere. To String: I am an Elf.... I can spell Name: Cosmo Type: Genie Color:blue Age: 1000 Talk: Magical Creature is talking. Live: I live in a bottle To String: I am a Magical creature Name : Cosmo Type Color Age : Genie : blue : 1000 Name: Harry Type: Goblin Color:red Age: 150 Talk: I talk Gibberish Live: Magical Creature lives anywhere. To String: I am a Magical creature Name : Harry Type : Goblin Color : red Age : 150 In display Dragons: I amJack: I am a Dragon! I breathe fire In display Dragons: I amJill: I am a Dragon! I breathe fire
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY