Drawing a Histogram to Display Survey Results

krazykrisi

Member
Joined
Dec 6, 2005
Messages
15
Programming Experience
1-3
I want to make a program that displays a histogra using asterisks in a message box using the followoing data from survey results > 15, 8, 12, 3, 2, 0, 3, 9, 12, 8
I want to store the values in an array as integer and display the results in two columns labeled Result and Histogram. I need to use the ControlChars.Tab to separate the columns. Build the entire output message in a string variable using nested For Loops. The outer loop should loop from 0 to the upper-bound value of the array. The inner loop should loop from 1 to the value of the next survey result. How would I separate the data into rows and columns and do I just put this all in the load form event or what?
 
You're going to have a very hard time doing that in a MessageBox. That's because you cannot specify the Font that the MessageBox uses, so positioning things is going to be difficult. If this is your own app then I strongly suggest using a proper charting component. If it's homework then you should at least create your own form and use a Label so that you can specify a fixed-width font to make things easier. Also, I believe that tab characters don't actually show up in Labels, so you have to use spaces.
 
I've read your post again. Those seem like fairly specific instructions, so I'm guessing that they have come from a teacher. The general attitude towards homework around here is that you show us what you've got and we'll give you pointers on how to improve it. If you come with nothing then... you can't really expect us to do your homework for you. You should at least be able to make a start.
 
Thank you for your negative attitude. I was able to do it in a MessageBox and it turned out good. I understand that you won't do my homework for me and I wasn't asking you to I was simply asking a question. I don't think I'll be coming back here for help again seeing as how you treat me is like I'm a complete idiot. Thanks.
 
Back
Top