Question: 15 You are writing a game and need a function to calculate how mary points a player recelves from a battle. For starting the battie,
15 You are writing a game and need a function to calculate how mary points a player recelves from a battle. For starting the battie, the player earns 58178 points. 8ut it the character Wins the battle, then they will earn additional bonus points Write a function named coupute xp that takes two parameters. The first parameter represents the bonus points possible for this battle. The second parameter wil have the value true if the character won the batte and have the value false if they lost the battle. Your function should calculate how mary points the player should receive. This means if the second parameter is false, 58178 is retumed (e.g. the points earned for starting the battel. But if the second parameter is true, then the function should retum 58178 plus the value of the firt parameter (e.g, the points eamed for starting the battle PLUS the bonus points for winning it) I functien copote ip(oonis. berints, mon bottie)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
