Need arduino basic programming ebook

Well I don't know what your test will cover, but my advice on how to learn this stuff is first to work through those tutorials (ie entering and running the code, not just reading it).

Then think of some ways of combining some of those tutorial snippets into some simple projects. I for example remember I mounted an LDR on the end of a servo horn. Then I combined the LDR example code with the servo example and had a servo that ran back and forth looking for light; when the LDR moved into some light it stopped. Then when I turned the light off, it started up again.

The tutorials and the reference surely explain all of the functionality; the trick is knowing how to combine the elements into a working program. That comes with solving some real-world problems (even if they are trivial to start with).

I can't help wondering why your school hasn't provided sufficient text or links?