The Modulo operator Unplugged programming challenges

These programming challenges revolve around the "modulo" function ("mod" in Scratch, or "%" in some languages). The modulo function occurs so much in Computer Science that we think it's worth exploring in its own right. The exercises here correspond to some of the Unplugged modulo activities. You'll also find programming exercises that use modulo in the exercises relating to hash tables for searching, the check digits for error detection.

Number Name Challenge Level Languages
1.1 Check for odd/even numbers using “mod” operation Growing experience
2.1 Check if a number is a divisor of another number Growing experience
3.1 Add hours on a clock (12-hour clock) Growing experience
3.2 Add hours on a clock without using “mod” (12-hour clock) Growing experience
3.3 Add hours on a clock (24 hour clock) Growing experience
4.1 Display MIDI note names Growing experience
5.1 Add number of months to a given month Growing experience
6.1 Add seconds, minutes and hours of two video clips Growing experience
7.1 Check if a year is a leap year Growing experience