
Originally Posted by
apricotsun
Sorry. My question was what is wrong with my code. Thank you for responding. I'm trying to figure out your answers. What do you mean out of scope? How do I fix it?
There really is too much wrong with your code to even bother trying to teach it all to you here.
Code:
static void Main(string[] args)
{
int[] sales = new int[9];
int[] frequency = new int[9];
for(int counter = 0; counter < 9; counter++)
{
Console.Write("Enter in the sales for the salesperson: ");
sales[counter] = Int32.Parse(Console.ReadLine());
}
for (int counter = 0; counter < 9; counter++)
{
frequency[(Convert.ToInt32((sales[counter] * .09)) - 1)] = (frequency[(Convert.ToInt32((sales[counter] * .09)) - 1)] + 1);
}
int ranges = 200;
for (int counter = 0; counter < 9; counter++)
{
Console.WriteLine(ranges.ToString() + "-" + Convert.ToString(ranges + 99) + ": " + frequency[counter].ToString());
ranges = ranges + 100;
}
Console.ReadLine();
}
That should give you close to what you want, i'll have to charge you for any further customization