Lessons‎ > ‎old lesson page‎ > ‎

Introduction to programming, lines, and parameters


This thread teaches students how to use the calculators to write short iterative programs that draw lines.  Topics include: calculator modes, editing, checking, and debugging programs, use of the pt-on() function to draw points, the construction of iterative programs that draw lines, the use of variables to serve as parameters that control algorithm behaviors, and an accessible introduction to the intuitions underlying the algebra of straight lines. 

Lesson 1: Intro to programming and line drawing 

  • Summary:
    • In this lesson, students are introduced to the calculators' coordinate system, the use of named variables to store and recall values, and then enter, execute, examine, and modify a simple model program that draws a line using iteration.
  • Instructions: How to program the calculators.  
    • Notes
      • This lesson should take ~45-50 minutes  
      • Give students a copy of the reference card and the lecture slides at the end of the class session
      •  Assign variant project as homework (such as write a program that draws a line from (10,10) to (20,30).  This is critical because it forces students to practice skills needed for the next lesson.
      • Be careful to not overload or distract students with topics that can be delayed until students are ready
        • e.g. operator precedence, editing tricks, keyboard shortcuts, variable naming rules. 
      • Avoid references to algebra.  S is "step," not slope.  We will examine versions of this program where S is not slope . 
    • Homework: students draw line segments connecting specified coordinate pairs from(c,d) to (p,q)
    • Follow-on class observations
      • scaling of x and y step sizes: e.g. adding (1,1) is same as (2,2), but only draws half of the points
      • can only step left-to-right if adding positive values to X, so C must be less than Q
  • Learning outcomes from first session
    • Familiarity: can identify
      • calculator modes: command, editing, graph, window param setting
      • coordinates of specific pixels
      • editing programs
      • setting window parameters
      • programs as descriptions of sequential operations
      • while/end control structure used in model line-drawing program 
      • Relation of step size to segment steepness (intuitions of slope)
    • Tasks students can perform
      • Creating, changing, and running a simple looping program (but little fluency with editor) 
      • Entering editor, graph, and command modes
      • Selecting commands from the PRGM, DRAW, and TEST menus
      • Typing alphabetic and numeric characters including colon
      • Writing and interpret simple arithmetic statements that reference and set variables  
      • Drawing a dot using pt-on(x,y)
    • Synthesis/analysis 
      • Determine how to change model program to draw alternate line segments that
        • Are qualitatively different (higher, steeper, longer)
        • Start at different coordinates than model program specified by instructor
        • End at different final column
        • Connect specific coordinates for particularly simple X and Y displacements (e.g 10 and 20)
      • Predict characteristics of lines drawn by particular programs

Lesson 2: Using variables as parameters (a precursor to algebraic abstractions describing lines in 2-D) 

  • Summary: 
    • In the previous lesson, variables are only used to store values that the program changes.  In this lesson, some constants used in the model program to control behavior are replaced by variables  in a manner that permits the looping portion of the program to draw line segments connecting arbitrary pairs of coordinates through setting of these "parameter" variables.  This concept is then extended by adding additional "parameter variables" that specify segment endpoint coordinates (c,d) and (p,q) where c<p, and students construct program fragments that compute suitable "parameter values" used to control the loop itself.  To facilitate checking whether the programs function correctly, the programs used in this lesson draw dots at endpoint coordinates prior to drawing the line segments.  Since students are now familiar with the concept of editing a program and surely have needed to correct programming errors, this lesson is also provides an opportunity to introduce the use of the INS command to insert lines and characters.
  • Instructions
    • Not posted yet
  • Learning outcomes
    • Familiarity: 
      • Informal concept of parameters as variables used to control program behavior
      • How a program can use one set of parameters to compute another set of parameters in order to present a more convenient interface
      • That different programs can compute identical or similar results  .
      • How to compute step size algebraically from segment endpoints (effectively slope)
      • Iteration over X, Y, both in positive and negative directions, intuitions regarding sign and magnitude of iteration stride
      • Concept of debugging and building "checks" into programs that confirm proper behavior. .
    • Tasks students can perform
      • Define simple equations and program fragments to compute parameters for variants of model program from earlier lesson where the fixed increment and limit are associated with either axis and the increment has either positive or negative (specified) values.
      • Competently edit programs on the calculators
  • In this lesson, the line drawing program is "parameterized" by replacing constants used in the model program to specify step size and X limit with variables S and L
  • Composition, parameters, editing, and debugging
This lesson extends an early lesson developed for iMPaCT was designed by Eric Freudenthal and Alexandria Ogrey.