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
Learning outcomes

Students will be able to:

Challenge Solutions
Show Scratch solution
Show Python solution
Show Block-based solution
2.1 Check if a number is a divisor of another number
Growing experience
Learning outcomes

Students will be able to:

Challenge Solutions
Show Scratch solution
Show Python solution
3.1 Add hours on a clock (12-hour clock)
Growing experience
Learning outcomes

Students will be able to:

Challenge Solutions
Show Scratch solution
Show Python solution
3.2 Add hours on a clock without using “mod” (12-hour clock)
Growing experience
Learning outcomes

Students will be able to:

Challenge Solutions
Show Scratch solution
Show Python solution
3.3 Add hours on a clock (24 hour clock)
Growing experience
Learning outcomes

Students will be able to:

Challenge Solutions
Show Scratch solution
Show Python solution
4.1 Display MIDI note names
Growing experience
Learning outcomes

Students will be able to:

Challenge Solutions
Show Scratch solution
Show Python solution
5.1 Add number of months to a given month
Growing experience
Learning outcomes

Students will be able to:

Challenge Solutions
Show Scratch solution
Show Python solution
6.1 Add seconds, minutes and hours of two video clips
Growing experience
Learning outcomes

Students will be able to:

Challenge Solutions
Show Scratch solution
Show Python solution
7.1 Check if a year is a leap year
Growing experience
Learning outcomes

Students will be able to:

Challenge Solutions
Show Scratch solution
Show Python solution