Repetition

Let's extend our program in one more way. Computers excel at repeatedly
carrying out a task. For example, perhaps we'd like a procedure that would
take an angle as its argument and print out the distance covered by the block
on the ramp every second for ten seconds. Here's a procedure called
``manyDistances'' that does just that.

manyDistances[theta_]:=
Do[
Print[t, " seconds: ", distance[t, theta], " meters"],
{t, 0, 10}];

You should try this procedure out for several different values of theta. For
example:

manyDistances[Pi/3]

This is an example of a kind of statement called a loop. The printing
statement is executed eleven times, first with t=0, then with t=1, and so
on until t=10.