The 20 exercises below are designed to help you practice programming in any imperative language.
- find 0 #1;
- find "stop" #1;
- read words;
- find "stop" #2;
- read numbers #1;
- read numbers #2;
- find "stop" #3;
- find 0 #2;
- read numbers #3;
- find "stop" #4;
- read numbers #4;
- read numbers #5;
- multiples of 5;
- multiples;
- dice game #1;
- 421 in order;
- drawing cards;
- dice game #2;
- heads or tails;
- 421 out of order.
Note to instructors: in the programs featuring the little robots, the universe was relatively closed, allowing the software to check the accuracy of the code generated by the learners to some extent.
This more or less automatic verification was abandoned in the 20 exercises opposite, as it was felt that the learners had reached a sufficient level to judge for themselves, at least in part, the accuracy of their programs. However, the eye of the expert (i.e. you) remains essential for the final validation of the programs, especially those where attention is drawn by the mention of "robustness" (risk of division by 0, reading of out-of-bounds values, etc.).
The advantage of this programming "freedom" is that you can create your own statements and ask learners to develop them via this interface, as long as your exercises require no more than 8 variables and no more than 30 lines of code.
We welcome your suggestions for adding to the collection of exercises on offer.
In any case, your opinions and suggestions will always be appreciated, and we wish you all the best in your work.
Rupert