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
"The correct syntax for passing an array as an argument to a method when a method is called and an array is passed to it is: "
Monica [59]

Question:

"The correct syntax for passing an array as an argument to a method when a method is called and an array is passed to it is: "

A) a[0]..a[a.length]

B) a()

C) a

D) a[]  

Answer:

The correct answer is A.

An example is given in the attachment.

Cheers!

4 0
3 years ago
You can enter the following things in cells
katrin [286]

Answer:

You enter three types of data in cells: labels, values, and formulas.

Explanation:

I hope this is the right answer I knew it on top of my head but I made sure with goggle to.

3 0
2 years ago
Write a program that has a user guess a secret number between 1 and 10. Store the secret number in a variable called secretNumbe
Tom [10]

Answer:

Explanation:

The following code is written in Python. It is a function called guessMyNumber and like requested creates a random number and saves it to secretNumber. Then it continuously asks the user for their guess and compares it to the secret number. If the guess is correct it exits the loop otherwise it will continue to ask for a new guess.

import random

def guessMyNumber():

   secretNumber = random.randint(1, 10)

   print(secretNumber)

   while True:

       guess = input("Enter your guess: ")

       guess = int(guess)

       if (guess == secretNumber):

           print("Congratulations you guessed correctly")

5 0
3 years ago
Identify science and technology policies that could be adapted or implemented in the Philippines?​
mina [271]

Answer:

In the Philippines, universities dominate the research arena. So you have scientists who make research for the sake of research.

The private sector may or may not adopt the research. If a research in UP finds a molecule that may kill cancer, we are not sure whether that research will be adopted or not.

We are not sure if that research will be continued to actual creation of a medicine of cancer. This is because our scientists are working in universities and not in actual pharma companies.

In other countries, the scientists build their own companies. So their research go from drug development to actual manufacturing and marketing of medicines.

So when they start a research, you know that in the next 5 to 10 years, these scientists will produce drugs which the public can benefit from.

This is why the Philippine research is not thriving as it should. Our government should support our start ups.

When scientists are given grants for research, they should also be given grants to start their company. Unfortunately, start up grant is not a function of the DOST. It is of the DTI.    

Explanation:

6 0
2 years ago
my pc wants to run the highest graphics even though I restart it everyday and it gets around 10 fps and I have a 1080 Nvidia gra
Luden [163]

Answer:

you have to restart the rom , if that doesnt work , start the ram

Explanation:

5 0
3 years ago
Other questions:
  • An attribute whose value uniquely identifies an object is called a(n) _______.​
    15·1 answer
  • If you need to use a custom theme frequently, you can save a presentation file as a(n) ____ theme file.
    12·2 answers
  • --------------communication involves one speaker andaudience.
    12·1 answer
  • what is a massive online storage that allows for Access by any internet-connected device running web browser. use for Less priva
    6·1 answer
  • You recently started working part-time in a retail store, and are learning about the reading devices your store uses. Your store
    10·1 answer
  • 100 POINTS + BRAINLYEST TO FIRST PERSON THAT IS CORRECT!!! Which items can be found in the Properties section of the Backstage V
    15·2 answers
  • Justin signed a rental agreement for his new condo. How long is his lease? a p e x
    15·1 answer
  • What is sum after the following loop terminates? int sum = 0; int item = 0; do { item ; sum = item; if (sum > 4) break; } whi
    8·2 answers
  • A new object of type list is created for each recursive invocation of f.A. TrueB. False
    15·1 answer
  • In this lab, you complete a C++ program that uses an array to store data for the village of Marengo.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!