Skip to main content
CS Teaching Tips

Main navigation

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

Remind students to match types on both sides of the equations because they often try to combine types when creating variables.

Share Remind students to match types on both sides of the equations because they often try to combine types when creating variables. with FacebookShare Remind students to match types on both sides of the equations because they often try to combine types when creating variables. with Twitter
  • Ints need to be equal to ints, and doubles to doubles.
    • A common error occurs when students try to set an int equal to a string.
      • For example, int num = "2.5";
    • This stems from not fully understanding that the type on the left of an equation has to equal the type on the right of the equation.

More about this tip

Tags

  • CS 1
  • Intro Programming
  • Programming Concepts
  • Content Misconceptions
External Source

Interview with Dani McAvoy

Other Tips By
Other Tips By Dani McAvoy

Similar tips

Misconception: Students often think that classes hold Objects rather than understanding that they’re a blueprint for Objects because of the main method.
Misconception: Students have trouble understanding the overall flow of a Ruby on Rails application when they access an individual page.
Emphasize to your students that in languages like Java a semicolon ends a complete thought, rather than just a line of code.
  • 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