Question: C++ You will create four functions: printYouWin() void return, no parameters printYouLose()- void return no parameters monsterAttacks() int return, no parameters heroAttacks(int atkBonus) int return,

C++

You will create four functions:

printYouWin() void return, no parameters

printYouLose()- void return no parameters

monsterAttacks() int return, no parameters

heroAttacks(int atkBonus) int return, integer parameter

Inside main you will have two int variables one for a monsters health and one for the heroeshealth. They will both be set to 20.

The program starts by calling heroAttacks() and send in an attack bonus (A random numberbetween 0 and 2).

Hero attack will return a random number between 1 and 5 + the attack bonus sent in.

The integer returned will be subtracted from the monsters health.

Then you will subtract the heros health from the integer returned from monsterAttacks()

Monster attack will return a random number between 1 and 6.

You should have a meaningful message print when each character takes damage

After one of the characters health falls below 0, then check to see if is the monster or the hero. Call you win/ you lose appropriately.

please include function prototypes

#include

#include

include

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!