1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
denis23 [38]
2 years ago
14

Derived Classes Warrior Stores the warrior's allegiance as a string. The warrior does not attack warriors that have the same all

egiance. The damage done by the warrior is the percentage of the warrior's health remaining (health / MAX_HEALTH) multiplied by the warrior's attack strength. Elf Stores the elf's family name as a string.The elf does not attack elf's from its own family.The damage done by the elf is the percentage of the elf's health remaining (health / MAX_HEALTH) multiplied by the elf's attack strength.WizardStores the wizard's rank as an int.When a wizard attacks another wizard, the damage done is the wizard's attack strength multiplied by the ratio of the attacking wizard's rank over the defending wizard's rank.The damage done to non-wizards is just the attack strength. The wizard's health is not taken into consideration.Dynamic casting type of Character in attack functionIn order to access the Warrior data field allegiance using the Character reference passed in to the attack function, you will need to dynamic cast the Character reference to a Warrior reference.Here's an example of dynamic casting a Character reference named opponent to a Warrior reference named opp:Warrior &opp = dynamic_cast(opponent);You will need to do the same for the Wizard and Elf attack functions, only dynamic casting to Wizard or Elf reference instead.HeroTypeNotice the enum declaration above the Character class declaration. This creates a special type called HeroType that has the values, WARRIOR, ELF, and WIZARD. Those are the values you store in a variable of type HeroType. For example, you can initialize a variable of type HeroType and set it to the value of WARRIOR like this:HeroType type = WARRIOR;You can compare a variable named t of type HeroType to one of the HeroType values like this:if (t == WARRIOR) { // do something based on t being a warrior}Example main function
Computers and Technology
1 answer:
olga_2 [115]2 years ago
8 0

Answer:

Find the detailed code in attached file.

Explanation:

See the attached file.

Download txt
You might be interested in
Which is true regarding networks?
shutvik [7]
Local Are Network (LAN) is a network that connect computer (or other network devices) in a limited area (local area).
Wide Area Network (WAN) on the other hand is a network that connects computers on a a large geographical area. According these definitions, the following statement is true:
C) wide are network allow users to share files with a secure connection

4 0
3 years ago
Read 2 more answers
What is segmentation and paging?
iogann1982 [59]

Over the years, operating systems have sought to be more efficient, which is why it is vital that the use of main memory such as ram be as intelligent as possible, so that operating systems are more efficient.

Segmentation is a process of dividing the program into logical units, such as sub functions, arrays, variables, etc., making it possible to have processes divided into pieces so that it is easy to access each of the processes that this leads to its execution. Segmentation allows the programmer to contemplate the memory as if it had several address spaces or segments. References to memory consist of an address of the form segment number - offset.

Pagination is a technique where memory space is divided into physical sections of equal size, called page frames. The programs are divided into logical units, called pages, that are the same size as the page frames. In this way, an information page can be loaded in any page frame. The pages serve as an information storage unit and transfer between main memory and auxiliary or secondary memory. Each frame is identified by the frame address, which is in the physical position of the first word in the page frame.

8 0
2 years ago
Your mother wants to purchase a larger hard drive for her computer and asks you to see what type of drive interface she has. her
Darya [45]
Your mom has what is called a Parallel ATA interface. Her computer is very old and I suggest more than just a hard drive :)
5 0
3 years ago
Read 2 more answers
The % symbol is the remainder operator, also known as the ________ operator.
faust18 [17]

Answer:

It's also called the modulo operator.

6 0
2 years ago
Read 2 more answers
Which of these characteristics is most important to a systems analyst? (1 point) (Points : 1.5) communicator
zvonat [6]

Answer: Problem solver

Explanation:

 Problem solver is the most important characteristics for the system analyst as it important for the organization to control all the problems.

System analysis basically define the problem in the particular organization to be solved and also provide the proper architecture in the system.  

The good and strong problem solving ability makes the organization more efficient in the decision making problem and also improve the overall system analyst in the organization.

7 0
3 years ago
Other questions:
  • What should a safe username do?
    14·2 answers
  • If your BAL is .10 you can expect a _______ drop in complex performance compared to the sober level
    6·1 answer
  • Hi I am Khine Mye and I want to ask you a question I don't know that is square root of 2 is 1.4 and how to get that 1.4 and plz
    8·1 answer
  • The following code accomplishes which of the tasks written below? Assume list is an int array that stores positive int values on
    9·1 answer
  • I need help under standing an assignment, I've contacted my teacher but I want to finish this class already. Here's the directio
    11·1 answer
  • When you see an ad on social media that relates to your profile or something
    5·2 answers
  • What is the difference between php and html?​
    13·2 answers
  • Which tab do you open to access the Comments feature?
    11·1 answer
  • If anyone knows how to code on python:
    8·1 answer
  • Which item is developed last in the cyclical process?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!