Question: REMEMBER TO ANSWER BOTH (i) & (ii) (i) Write a declaration for a C++ structured-record type named Monster that includes as fields: a string named

REMEMBER TO ANSWER BOTH (i) & (ii)
(i) Write a declaration for a C++ structured-record type named Monster that includes as fields: a string named name, an integer named attack_high, and a non-negative integer named attack_low.
(ii) Use the structured record from the previous question to write a function named monsterDamage that is given
(1) a Monster named m1
the parameter should not change and should be passed by reference for speed. Use the best return type.
the function should:
(1) get a random value between attack_high and attack_low
(2) print the monster's name and how much damage it does in the format: "monster name deals amount of damage points of damage"
(3) return how much damage the monster did
C++
REMEMBER TO ANSWER BOTH (1) & (ii) O Write a declaration for a C++ structured-record type named Monster that includes as fields: a string named name, an integer named attack_high, and a non-negative integer named attack_low. (ii) Use the structured record from the previous question to write a function named monsterDamage that is given (1) a Monster named m1 the parameter should not change and should be passed by reference for speed. Use the best return type. the function should: (1) get a random value between attack_high and attack_low (2) print the monster's name and how much damage it does in the format: "monster name deals amount of damage points of damage" (3) return how much damage the monster did
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
