My immediate inclination is:
ssh from Mobile Terminal to a machine you can run your program on
I'm sure there's documentation for getting tools installed in Mobile Terminal but I don't know how to do it, and me looking it up is no more useful than you looking it up. Also I think general jailbreaky stuff is in a grey area on the forums.
Also... There's still a place for computers. You didn't write, test, and debug this code on your iPad. Running it on one for show is fine, but honestly... you know how to run it in your computer, and you don't know how to on your iPad. Learning is great, so learn! By all means. But maybe it's better to just show your teacher on a computer, get your extra credit, then figure out the iPad hootenanny.
Care for us to review your code?
-Lee