Students learn how to program using loops and switches. They see how loops enable us to easily and efficiently tell a computer to keep repeating an operation. They also see that switches permit programs to follow different instructions based on whether or not preconditions are fulfilled. Using the LEGO MINDSTORMS(TM) NXT robots, sensors and software, student pairs perform three mini programming activities using loops and switches individually, and then combined. With practice, they incorporate these tools into their programming skill sets in preparation for the associated activity. A PowerPoint® presentation, pre/post quizzes and worksheet are provided.
Students are given a difficult challenge that requires they integrate what they have learned so far in the unit about wait blocks, loops and switches. They incorporate these tools into their programming of the LEGO MINDSTORMS(TM) NXT robots to perform different tasks depending on input from a sound sensor and two touch sensors. This activity helps students understand how similar logic is implemented for other every day device operations via computer programs. A PowerPoint® presentation, pre/post quizzes and worksheet are provided.