11
I’m starting my programming and a question has arisen during my conditions. I do a check of how many times the result was true, and how many times it was false. Problem is you’re not giving me the real result.
The only way I’ve found to work is this:
if (Lstr_Resultado1 == "Verdadeiro")
{
Lint_TotalVerdadeiro++;
}
else
{
Lint_TotalFalso++;
}
if (Lstr_Resultado2 == "Verdadeiro")
{
Lint_TotalVerdadeiro++;
}
else
{
Lint_TotalFalso++;
}
if (Lstr_Resultado3 == "Verdadeiro")
{
Lint_TotalVerdadeiro++;
}
else
{
Lint_TotalFalso++;
}
I believe there’s a more performative way to do that. I know I’m starting and the application is simple but I try to reduce the use of machine processing. What would be the best way to resolve that amount of if / Else?
You cannot change your question. If you have a new question, ask a new question. Probably your code might be a lot better than this, but in your original question you didn’t have any of this, people can’t have to keep adapting the answers every time you change the question.
– Maniero
Lack of context and responses creating structures is nothing performatic. But as it lacks context, maybe this can be.
– novic
@Maniero Certo. was a new doubt that has already been solved.
– Pedro Duca