I am trying to create a method that will step through an array with a for loop and if they array subscript is greater than or equal to the minimum requirement a string array subscript will be added to a listbox.
Here is my feeble attempt, along with the method I've tried below it. When calling the method AwardMinimum, the whole thing is incorrect stating, "has some invalid arguments". Commented out is what every level looks like. (level <=10, level >10 && <=20, etc..)
if (level <= 10)
{
AwardMinimum(perDayArray, min, awardsArray);
/*for (int i = 0; i < STATSIZE; i++)
{
if (perDayArray[i] >= 2)
{
awardListBox.Items.Add(awardsArray[i]);
}
}*/
}
The method itself
private void AwardMinimum(double perDay, int min, string awards)
{
for (int i = 0; i < STATSIZE; i++)
{
if (perDay >= min)
{
awardListBox.Items.Add(awards);
}
}
}
perDayArray,min, andawardsArraycome from and what are their types?