Loading...
Logo
Processing Forum
Write a program to display some data in bar graph form. Have at least 20 elements, which can be positive or negative; draw each element with a vertical bar, going up if the data is positive or down if the data is negative. Once you have displayed the bar graph, allow a user to select a given element by cycling through the data with keys (e.g., 'a' to move left, 's' to move right) and print the exact value of the selected bar. Show the current selection by highlighting its bar somehow (e.g., drawing a thick outline around it).


Replies(5)

I deleted your two other double posts.

Just some notes.
If you want to get some help here. Dont double post. it makes sense to have it all in one place. People will find your post no matter where it is. 
Second one. Use a topic that already describes the problem. "hot girl" doesnt help you, it only helps to get deleted because it looks like spam. Third, dont change the type so its almost unreadable...
and probably most important. Dont just post your homework and hope to find somebody who will do it for you. 
We love to help, but show us what you already did, and how far you got and we will help and support you to solve the problem your self.



Write a program to display some data in bar graph form. Have at least 20 elements, which can be positive or negative; draw each element with a vertical bar, going up if the data is positive or down if the data is negative. Once you have displayed the bar graph, allow a user to select a given element by cycling through the data with keys (e.g., 'a' to move left, 's' to move right) and print the exact value of the selected bar. Show the current selection by highlighting its bar somehow (e.g., drawing a thick outline around it).

You could start with an array of int and assign it fixed values.
Then you for loop (i) over the array and paint rects with command rect(): 
the x-value is i*10, the y-value is 300 and the width is fixed (10) and height is the -1* value of the array in this place plus 300.
Then have a function keyPressed where a and s control a variable named selected and
in the for-loop check if selected == i strokeWeight(4) else strokeWeight(1).
  • etc.

see reference for all these words:

http://www.processing.org/reference/


Greetings, Chrisir   

Last recommendation, don't type a subject in all caps, that's annoying for most people.
I was tempted to delete this thread as well, but since you got answers...

You can edit your message to follow the recommendations.

[EDIT] No action seen, I edited myself...
Also if you say your hot atleast show a picture.
The least you can do is something back for the community :)

I don't believe either girl or hot.....