Array Method

if you want to keep a bunch of patients, a container (an array is a container) or a disk file (which is technically a container but it is not the same as a programmatic data-structure) are your best options.

you can do a graph, max/min, and similar things without storing the data, but here again, a container is the best way to do the graph! You need a container of COUNTS of total charge in ranges (range can be distinct, or range of '1') if that is what you want to plot. If you want to plot the different categories distinctly, then you need to save everything instead.

consider
int bargraph[number of buckets];
get a patient's cost amount
figure out what bucket that value is in
bargraph[bucket]++;
and at the end of it all the array is your bar graph, you just plot the counts in it. This same technique (an array of buckets) has a dozen applications so file it away in the back of your mind.

@NobodyButMe Please do NOT delete your question once you've got an answer. It makes the thread useless for anyone else trying to read it.
It's possible that he added some spam and was therefore deleted by someone.
(It wasn't me, so I can't confirm that.)
The site seems to disallow deletion by spam / report if there is a reply below the offending message. This was likely the user bailout. That is an annoying trend.
The OP deleted their original post by editing to say something like "I fixed it."

I'd guess someone reported (twice) the OP as a waste of bandwidth.
Topic archived. No new replies allowed.