Skip to main content
CS Teaching Tips

Main navigation

  • Browse All Tips
  • Tags
  • 3D
  • About
  • Rate Tips
  • Tip Sheets

Misconception: Students often have off by 1 errors when working with loops, which can result from mixing up > and >= as well as forgetting that arrays start at index 0.

Share Misconception: Students often have off by 1 errors when working with loops, which can result from mixing up > and >= as well as forgetting that arrays start at index 0. with FacebookShare Misconception: Students often have off by 1 errors when working with loops, which can result from mixing up > and >= as well as forgetting that arrays start at index 0. with Twitter
  • If students are repeatedly encountering off-by-1 errors, it may be the result of difficulty understanding either of this concepts.

More about this tip

Tags

  • CS 1
  • Intro Programming
  • Data Structures
  • Content Misconceptions
External Source

Interview with Michael Lee.

Other Tips By
Other Tips By Michael Lee

Similar tips

Have students analyze geographic data and election return data by making a graph of “Purple America” in Java so that they can develop the tools to visualize their own data through coding.
Misconception: Students may think that assigning one array to point to another array makes a copy of that array, failing to make a distinction between shallow and deep copies.
Meet with students one-on-one to help them develop a Java class in order to clarify basic concepts and increase their confidence with object-oriented programming.
  • CSTT Facebook
  • CSTT Twitter

For more information or to report a bug, contact us at admin@csteachingtips.org. Built with Bootstrap. Footer Icons by Mohammed Alyousfi. Powered by Drupal.

Privacy Policy

  • National Science Foundation
  • Sage Fox Group
  • Harvey Mudd College