Question: c+++ .c program Please comment everything so I can understand. 1 League of Legends: Problem Description In League of Legends, a player's Effective Health when

c+++ .c program Please comment everything so I can understand.
1 League of Legends: Problem Description In League of Legends, a player's Effective Health when defending against physical damage is given by A) where H is health, A is armor and E is the effective health. Health costs 2 gold per unit, and armor costs 18 gold per unit. In order for the player to survive as long as possible it is important to maximize the player's Effective Health E. 1.1 Program Description For a given amount of gold that the user wishes to spend, we can use a computer program to calculate the optimal amount of health H and armor A that will maximize the Effective Heath E. The two formulae that we will use are H (100A) 100 GoldToSpend = 2 . H + 18-A ey wish to spend, then caleulates the optimal amount of H Write a C program that asks the player how much gold th and A that the user should purchase in order to maximize HE Tips to solving this problem: Loop structure must be used,ot herwise 0 point for this problem 1. Loop across all possible values of 4; Th e minimum amount of armor that can be purchased is A 0 and the 2. For a given amount of A, solve the GoldToSpend equation for H 3. Calculate E 4. Keep track of the maximum amount of E seen during the loop. Also keep track of the corresponding A and H used to calculate the maximum E 5. Report the results 1.2 Test your program Sample Code Execution: Red text indicates information entered by the user How much gold do you wish to spend? 10 For 10 gold you should buy 5 Health, and 0 Armor for an effective health score of 5.000 Sample Code Execution: Red text indicates information entered by the user How much gold do you wish to spend? 1000 For 1000 gold you should buy 500 Health, and 0 Armor for an effective health score of 500.000 Sample Code Execution: Red text indicates information entered by the user How much gold do you wish to spend? 10000 For 10000 gold you should buy 2948 Health, and 228 Armor for an effective health score of 9669.440 Sample Code Execution: Red text indicates information entered by the user How much gold do you vish to spend? 1820 For 1820 gold you should buy 901 Health, and 1 Armor for an effective health score of 910.010 Sample Code Execution: Red text indicates information entered by the user How much gold do you vish to spend? 3603 For 3602 gold you should buy 1361 Health, and 50 Armor for an effective health score of 2026.500
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
