How do you make a horizontal bar graph. The user will input 4 numbers and they will show up accordingly on the graph. I am really stuck so if someone can help I would appreciate it

Printable View

- 11-25-2001robjulesHorizontal bar Graph?
How do you make a horizontal bar graph. The user will input 4 numbers and they will show up accordingly on the graph. I am really stuck so if someone can help I would appreciate it

- 11-26-2001adrianxw
>>> How do you make a horizontal bar graph.

On what and with what OS? - 11-26-2001robjulesHorizontal bar Graph
This is what I have to do. I know bsically how to do the coding for it all except the graph. It is on Microsoft C++ version 6.0.

Create a program that takes 4 positive numeric values(North, East, South, West) as input from the user and creates a horizontal bar graph. The bars will consist of a given number of symbols (i.e. *) used to denote the entered quantity. For example, if the user enters 12, the bar will be a series of 12 *. The numbers may be decimal, but they will need to be rounded. So, you will create a function to facilitate rounding.

Also, you must use error checking to ensure the user enters a positive numeric value. An appropriate error message must be displayed to the user, should an error be detected.

The mean of the 4 values must be calculated and displayed below the bar graph in a summary section. The bar graph must have both an x-axis and y-axis with labels for the y-axis and a numeric scale on the x-axis. In addition, you will want to provide the exact value at the end of each bar.

test data:

220,5,3.14,1

-10,-1,.49,.50

3.5,1.2,4.6,W

-.01,0,.99,.01

3.51,4.99,south,1.99 - 11-26-2001adrianxw
Okay, we're getting a bit nearer. So is this to show in a window, (use TextOut()), or a console, (use printf() or cout)?

- 11-26-2001guest
a single bar graph using 1 * to represent 1 item in text mode:

int num = 4;

int i;

for(i = 0; i < num; i++)

cout << '*';

To do a series of bar graphs use an array to hold all numbers to be represented in the graph and nested loops to "draw" the bars