I'm making a calculator for FPS games , and in it, you enter the number of Kills , and the number of Deaths . So far so good, I was able to make the command line for her to take the two values, and set the percentage, but at the time of the forecast is that I lose. I'm starting now with C # programming and I do not know what to use.
int kill, death;
double valor, KD_Porcentagem;
valor = kill + death; //É SOMADO OS VALORES TOTAIS
KD_Porcentagem = (kill * 100) / valor;//MULTIPLICADO O REQUERIDO POR 100, E DIVIDIDO PELA SOMA
Simple, I simply did rule three, putting that value equal to 100% and that kill is equal to KD_Porcentage. I tried to do the same, but it did not work. I am based on a calculator with the same scheme, and same idea, in which the following happens:
To kill = 90
and death = 30
KD_Power = 75%
In the forecast, the following occurs:
Forecast:
Kill / Death 76%: Kill less Death in the period has to be: 3
Kill / Death 77%: Kill less Death in the period has to be: 8
Kill / Death 78%: Kill less Death in the period has to be: 14
Kill / Death 79%: Kill less Death in the period has to be: 20
I've tried everything already, but I can not figure anything out ... Could you help?