winforms – C# WinsForm, Frequency Distribution Table [Updated]

winforms – C# WinsForm, Frequency Distribution Table [Updated]

I think, if your aim is to only store eg 17 in the 15 to 25 slot, this is wonky:

if (number <= (h * i) + minNumb) // Check if number is smaller than the range limit

Because its found inside a loop that will move on to the next range, 25 to 35 and it only asks if the number 17 is less than the upper limit (and 17 is less than 35) so 17 is accorded to the 25-35 range too

FWIW the range a number should be in can be derived from the number, with (number - min) / number_of_ranges – at the moment you create your eg 10 ranges and then you visit each number 10 times looking to put it in a range, so you do 9 times more operations than you really need to

winforms – C# WinsForm, Frequency Distribution Table [Updated]

Leave a Reply

Your email address will not be published.