You can certainly do this with Processing!
Check out the tutorials, examples and references here:
processing.org
Since you are new here:
- FAQ - Processing Foundation < If it is homework there is a section in here discussing that.
- Guidelines—Asking Questions
- Guidelines—Answering Questions
:)