Question: Write in C#, please. Hero class download link: https://ufile.io/947da Create a Console Application named YourLastName_PA3. For this project, you are to download the Hero.cs class

 Write in C#, please. Hero class download link: https://ufile.io/947da Create a

Write in C#, please.

Hero class download link: https://ufile.io/947da

Create a Console Application named YourLastName_PA3. For this project, you are to download the Hero.cs class file from D2L and add the file to your project. You are then going to add one method to the Hero class file, and then add 2 more classes to your project which will inherit from the Hero class. Finally, in Main) you will implement a small program to test your class files. Step 1: Download the Hero.cs class file from D2L. Add a method named AnnounceSelf() that prints to the console the Hero's Title and Health Points. This method should be created so that it can be overridden in derived classes. Only one method should be added, and no other part of the class should be modified. Step 2: Add two more classes to your project. Both of these classes will inherit from the Hero class. Each class should have an "Is-A" relationship to the Hero class. For example, you could create a Mage class, or Warrior class, or an Accountant class, or a Programmer class (Programmers are the Heroes of our time!) A) For each of the two classes, you should add 1 unique field/Property for that class B) For each of the two classes, you should override the inherited AnnounceSelf() method so that it prints the Hero's Title and the field/property value you added for that class C) For each of the two classes, implement any components necessary for the Hero inheritance to be valid Example: to my project I add a Mage class in which I add a MagicPoints field/Property. I modify the AnnounceSelf() method to output the text "I am a

with <magicpoints> Magic Points!". I then add a Warrior class, which I define a Strength field/Property for. I modify the AnnounceSelf() method to output the text "This <title> has <strength> strength!". Step 3: In Main(), create a List object that holds type 'Hero' objects. To this list, add two instances of each of your two classes, and initialize each instance in a unique way. Then, loop through each Hero in the list and call its AnnounceSelf() method Example output might look something like: I am a Mage with 35 Magic Points! This Warrior has 100 strength! I am a Dumbledore with 120 Magic Points! This Barbarian has 250 strength! Create a Console Application named YourLastName_PA3. For this project, you are to download the Hero.cs class file from D2L and add the file to your project. You are then going to add one method to the Hero class file, and then add 2 more classes to your project which will inherit from the Hero class. Finally, in Main) you will implement a small program to test your class files. Step 1: Download the Hero.cs class file from D2L. Add a method named AnnounceSelf() that prints to the console the Hero's Title and Health Points. This method should be created so that it can be overridden in derived classes. Only one method should be added, and no other part of the class should be modified. Step 2: Add two more classes to your project. Both of these classes will inherit from the Hero class. Each class should have an "Is-A" relationship to the Hero class. For example, you could create a Mage class, or Warrior class, or an Accountant class, or a Programmer class (Programmers are the Heroes of our time!) A) For each of the two classes, you should add 1 unique field/Property for that class B) For each of the two classes, you should override the inherited AnnounceSelf() method so that it prints the Hero's Title and the field/property value you added for that class C) For each of the two classes, implement any components necessary for the Hero inheritance to be valid Example: to my project I add a Mage class in which I add a MagicPoints field/Property. I modify the AnnounceSelf() method to output the text "I am a <title> with <magicpoints> Magic Points!". I then add a Warrior class, which I define a Strength field/Property for. I modify the AnnounceSelf() method to output the text "This <title> has <strength> strength!". Step 3: In Main(), create a List object that holds type 'Hero' objects. To this list, add two instances of each of your two classes, and initialize each instance in a unique way. Then, loop through each Hero in the list and call its AnnounceSelf() method Example output might look something like: I am a Mage with 35 Magic Points! This Warrior has 100 strength! I am a Dumbledore with 120 Magic Points! This Barbarian has 250 strength</strength>

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!