Each page has four programs drawn as flow charts. A program starts at a number, then repeats two steps: it prints the number, then changes it by the rule. In programs 1 to 3 the code is right but one number in the output came out wrong: students circle it, write the right number, and explain what went wrong. In program 4 the output is what the programmer wanted, but one block of code is wrong: students circle the bug in the code and explain how to fix it. Pages 1 to 4 are on grade level with all four operations; pages 5 and 6 are support pages that add and subtract within 100; pages 7 and 8 are a challenge, with bigger numbers and code that may do the opposite of what the output shows.
Debug the first program together: run the code one step at a time, compare each result with the output, and say out loud what went wrong. Save program 4 for a pair discussion: how can the output be right if the code is wrong?
Ask your child to run each program out loud. For program 4, ask what rule the output follows, then which block of the code says something else.
This pack supports the following Common Core State Standards for Mathematics:
© Copyright 2010. National Governors Association Center for Best Practices and Council of Chief State School Officers. All rights reserved.
Number patterns printed by simple programs, each with a bug to find. Students circle a wrong number, fix it and explain what went wrong, then find the wrong block in a program's code and explain how to fix it.
Tell us what to make next, or build your own with a worksheet maker.
This worksheet is free to download, print, copy, and hand out in your classroom or at home. You do not need to create an account, and there are no watermarks on the PDF.