I have a problem. I have this code but the problem is how do i put the results in a histogram form.
Can someone please help.
#include <iostream>
using namespace std;
int main()
{
const int arraySize=30, rangeSize=9;
int gross_Sales[arraySize]=
{ 2430, 3500, 9400, 14300, 4200, 1250,
9990, 5410, 5400, 6780, 3450, 10010,
5460, 1110, 8760, 4630, 9050, 6710,
6090, 4560, 7610, 10020, 11110, 5410,
3450, 1980, 6320, 9780, 8990, 10020};
int i, counter[rangeSize];
double salary;
for(i=0;i<rangeSize;i++)
counter[i]=0;
for(i=0;i<arraySize;i++)
{
salary = gross_Sales[i] * 0.09 + 200;
if (salary<1000)
counter[int(salary / 100) - 2]++;
else
counter[8]++;
}
int mindollar, maxdollar;
for(i=0; i<8; ++i)
{
mindollar=i*100+200;
maxdollar=mindollar+99;
cout << "$" << mindollar << "-$" << maxdollar
<< ": " << counter[i] << endl;
}
cout << "$1000 and over: " << + counter[8] <<
endl;
return 0;
}