I am making an application that will give me the Mean, Medium and Range of the numbers that have been inserted by the user.
But I cannot seem to add the numbers and then divide them by two.
Here’s what I attempted:
public static String Find_Mean()
{
int Number = 0;
for (int size = 0; size < list.Count; size++)
{
Number = Convert.ToInt16(list[size].ToString());
Number += Number;
}
int Final_Number = Number / 2;
return Convert.ToString(Final_Number);
}
What I want to do is add all the numbers together from the arraylist then divide them by 2.
you are re-assigning the value for Number here:
try this: