Creating A Bar Graph

Trying to create a bar graph with negative and positive temperatures, from temperatures uploaded by a file. Cant seem to get it printed correctly. Any advice is greatly appreciated.





void Print_Graph_High(int high_temp[],int total_days)
{
int num_day; // # of days, used as index of array
char symbol; // Graph symbol determined by the user's preference
cout << "What character would you like to use for the bar graph? ";
cin >> symbol;
cout << setw(4) <<" Day" << setw(4) << "Temp" << endl;
for(num_day = 0; num_day < total_days; num_day++)
{
cout << setw(4) << num_day;
cout << setw(4) << high_temp[0] << endl;
if(high_temp < 0)
{
for(high_temp[num_day] = -3; high_temp[num_day] > -40; high_temp[nu$
{
cout << setw(15) << symbol;
}
}
cout << "|";
if(high_temp[num_day] > 0)
{
for(high_temp[num_day] = 3; high_temp[num_day] < 120; high_temp[num$
{
cout << symbol;
}
}
}
return;
}
Topic archived. No new replies allowed.