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

Focus on simple examples in a breadth course about systems to avoid confusing students. Save depth for upper level courses.
Teach hierarchical task analysis using Requirement Cards to sort through 100 requirements engineers have created for a robot cleaning up a nuclear disaster.
Have students implement a simple GeoLocation class in Java that finds the distance between two locations using the Google Maps API to give students an interesting introduction to object-oriented programming.

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

Privacy Policy