Answer the question
In order to leave comments, you need to log in
Calculate % at different numbers (C#)?
Hello. There is this code:
double value = Convert.ToDouble(s);
double onePercent = value / 100;
value = value + onePercent * 10;
return value.ToString();
Answer the question
In order to leave comments, you need to log in
int arrayA[] = new int[5] { 200, 600, 1000, 1400, 2000 };
double arrayB[] = new double[5] { .3, .25, .2, .15, .1 };
for (int a = 0; a < arrayA.Length; ++a)
if (value == arrayA[a])
{
value += value * arrayB[a];
break;
}
if, case ...
Explain the essence of the task, otherwise in the description it is not very clear what you want. What kind of condition, how should it be considered.
Do you need to add 10 percent to the number?(Convert.ToDouble(s)*1.1).ToString()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question