0
I’m making a calculator for games FPS, and in it, you enter the number of Kills, and the number of Deaths. So far so good, I was able to do the command line so she could take the two values, and set the percentage, but at forecast time I get lost. I’m starting now with programming C# and I don’t know what to wear.
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 made rule of three, stating that the value is equal to 100% and that Kill is equal to Kd_percentage. I tried to do the same, but it didn’t work. Get me a calculator with the same scheme, and same idea, in which happens the following:
For Kill = 90
and death = 30
Kd_percentage = 75%
In the forecast, the following occurs :
Forecasting:
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’t think of anything... could help?
What kind of forecast do you want to make? Weather Forecast (Hehe)? Try to explain better what you want and what problem you are facing in trying to solve it, so we can help you.
– Fernando Leal
I want to predict the number, which added to Kill increases the percentage, remembering that it can be any number in a range between (int Kd_percentage) + 0.5 and (int Kd_percentage) + 1.0, in case, if the whole percentage is 75, I could take any number between 75.5 and 76, because the number will be rounded whenever it reaches one of these values. Do you understand? xD
– Douglas
"lembrando que pode ser qualquer número em um intervalo usando aquela fórmula que eu nunca mencionei antes..."
No. No one here knows the variables of your program or the rules of business. It’s okay to edit the question to contain more information and make it clearer, okay? Help us understand the problem and we will help you solve it ;)– Oralista de Sistemas
Please use the option edit of your question, and pass on the information necessary so that a person/programmer who is NOT on your side looking at your source code and seeing your finger being pointed at the problem can understand your problem and maybe (depending on the weather forecast) can help you.
– Fernando Leal
It’s not clear yet...
– Bruno Augusto
You have a wrong logic. If the player has 90 Kills, and 30 Deaths, his K/D is 3, can’t be 75% since it is Kill/Death... You have to see this
– Gustavo Cinque