Question: I ' m writing a C + + program to call a function, please help me with the part shown in the picture, because some

I'm writing a C++ program to call a function, please help me with the part shown in the picture, because some of the text parts can't be displayed on the page, so please look directly at the C++ program on the picture and teach me how to do it.```
#include
using namespace std;
const int MAX_NM__TOWER =4;
const int MAX_NM_FLOOR =4;
const int MAX_ENCOUNTER_LENGTH =10;
// Helper function to copy values an array to another. Provided.
void copy_floor(int to[], const int from[]){
for (int i=0; i \MAX_NM_FLOOR; i ++){
to[i]= from[i];
}
}
// Helper function to calculate strength based on operation
/**
* TODO:Given the current strength and an encounter, calculate the new strength.
* An encounter is a C string that contains an operator and a number (an integer), e.g."+10","M15","*2","M35".
* The operator can be '+','-','*','/', or 'M'.
*-'+' and '-' are normal addition and subtraction.
*-'*' is multip1ication.
*-'/' is integer division.
*-'IM' represents the monster encounter. If the current strength is greater than the number, you defeat the monster and add the number to the strength. Otherwise, assign -1 to strength.
* Note that you need to extract the number from the C string and convert it to an integer before performing the operation.
*/
int calculate_strength(int strength, const char encounter[MAX_ENCOINTER_LENGTH]){
return 0;
}
```
I ' m writing a C + + program to call a function,

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 Programming Questions!