Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hero class down below: Please write in C# console application. Create a Console Application named YourLastName_PA3. For this project, you are to download the Hero.cs
Hero class down below:
Please write in C# console application.
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 aStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started