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]
3 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]3 years ago
8 0

Answer:

Find the detailed code in attached file.

Explanation:

See the attached file.

Download txt
You might be interested in
Headphones are an example of _____.
katen-ka-za [31]
The Answer Is An Output Device 


3 0
3 years ago
Read 2 more answers
The answer for this question?
Debora [2.8K]
It will flow from 2 to 1
6 0
3 years ago
What is an example of a source that is less likely to be copyrighted?
Ivahew [28]
An example would be a: motorized vehicle aka a car or a bike etc.
8 0
3 years ago
Read 2 more answers
Which element can be changed using the Print pane? Check all that apply.
Ronch [10]

Answer:

B

C

D

E

Explanation:

5 0
3 years ago
Read 2 more answers
Andrea wants to to install a new internet connection . she eants to use the fastest one she can find . what are the maximum spee
DaniilM [7]

A dial-up access connection supports a speed up to <u>5</u><u>6kbps</u>, whereas an ISDN line goes up to 1.9Mbps. A DSL connection can support a maximum of 20<u>mbps</u>. Internet access speed through cable TV is capable of up to 1000mbps.

Dial-up connection is by far the slowest of all known internet connections. The maximum speeds that can be supported by this connection are about 56Kbps. Use of this type of connection requires a separate phone line. In an ISDN type of connection, the maximum speeds depend on where in the world you are. The highest to have ever been recorded is an ISDN E1 line that has a combined data rate of 1.9 Mbit/s. Speeds transmitted through DSL are generally the same ones that are transmitted through cable internet and satellite connection. You can expect DSL speeds of 512Kbps to a max of 20Mbps. The cable internet is a broadband internet access and the highest bit rates of cable internet can go be up to 1GBPS which is equivalent to 1000Mbps.

6 0
3 years ago
Other questions:
  • Which of the following typically have the highest auto insurance premiums?
    14·1 answer
  • What network setting do i need for a workgroup?
    5·1 answer
  • What defines "print media"? It is media that includes words and text rather than video, such as many blogs. It is media that is
    8·1 answer
  • CLS <br> N = 1<br> FOR J = 1 TO 5 <br> PRINT N<br> N = 10*N+1 <br> NEXT J<br> END
    14·1 answer
  • Driswers.
    13·2 answers
  • Excerpt from "How Prepared Are Students for College Level Reading? Applying a Lexile-Based Approach."
    6·1 answer
  • Lasses give programmers the ability to define their own types. <br><br> a. True<br> b. False
    10·1 answer
  • Davingould1115...................answer 2​
    11·2 answers
  • A numeric test score is to be converted to a letter grade of A, B, or C according to the following rules: A score greater than 9
    15·1 answer
  • What is the purpose of memory address?​
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!