Fork diagrams for teaching selection in CS I

  • Authors:
  • Amruth N. Kumar

  • Affiliations:
  • Ramapo College of New Jersey, 505, Ramapo Valley Road, Mahwah, NJ

  • Venue:
  • SIGCSE '96 Proceedings of the twenty-seventh SIGCSE technical symposium on Computer science education
  • Year:
  • 1996

Quantified Score

Hi-index 0.00

Visualization

Abstract

We propose a fork diagram as a visual representation of the algorithm for binary selection. Among other things, fork diagrams can be used to teach students how to write correctly nested if-else statements, analyze nested selection code, appreciate the problem of dangling else, and understand short circuit evaluation of conditions with boolean operators (and and or). We have used C code to illustrate concepts, although fork diagrams can be used for any high level language.