+
Pair-Programming: Variables, Vectors, and the Programming Environment

Developed by Katrina Hay and Bret Underwood - Published December 6, 2023

DOI: 10.1119/PICUP.Exercise.variables

This is a beginner-level pair-programming activity that is highly scaffolded, where the “Driver” and “Navigator” students in the pair are given specific and different simultaneous tasks. No prior programming experience is necessary. In this 40-minute activity, students learn to define types of variables, such as scalars and vectors, and perform simple calculations. Modification is included for groups of three. ![](images/MATLABvariables/HAY_Navigator_Driver_Image_Small.png "")
Subject Area Programming Introductions
Levels First Year and Beyond the First Year
Available Implementation MATLAB
Learning Objectives
Students who complete this exercise set will be able to: 1. Be familiar with the programming environment and workspace (e.g. [Exercise 3, 4, 5, 6, and 9]. 2. Run simple calculations (e.g. [Exercise 3, 4, 5, 6 and 7]. 3. Assign scalar and vector variables (e.g. [Exercise 5, 7, 9, 10, 11, 12, and 13]. 4. Work in pairs to write computer programs, enhancing the code as well as improving person-to person communication (e.g. [the scaffolding of the entire exercise set].
Time to Complete 40 min

These exercises are not tied to a specific programming language. Example implementations are provided under the Code tab, but the Exercises can be implemented in whatever platform you wish to use (e.g., Excel, Python, MATLAB, etc.).

The “Exercises” are provided as a scaffolded worksheet to use in pair-programming style. See the attached worksheets. Multiple versions available (one is MATLAB-specific, and the other is general/pseudocode which contains highlighted sections that need to be adjusted for the programing software the instructor chooses to use). Four files are included: LAB_1_Variables_Vectors_General The exercise set as a Word document, independent of programming language. Includes sections for instructor to fill in specifics, depending on language used. LAB_1_Variables_Vectors_General_Solutions Pseudocode general solutions LAB_1_Variables_Vectors_MATLAB_Specific The exercise set as a Word document, for MATLAB programming language. LAB_1_Variables_Vectors_MATLAB-Specific_Solutions Solutions in MATLAB file. These are the solutions students are expected to generate during this lab activity.

Download Options

Share a Variation

Did you have to edit this material to fit your needs? Share your changes by Creating a Variation

Credits and Licensing

Katrina Hay and Bret Underwood, "Pair-Programming: Variables, Vectors, and the Programming Environment," Published in the PICUP Collection, December 2023, https://doi.org/10.1119/PICUP.Exercise.variables.

DOI: 10.1119/PICUP.Exercise.variables

The instructor materials are ©2023 Katrina Hay and Bret Underwood.

The exercises are released under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 license

Creative Commons Attribution-NonCommercial-ShareAlike 4.0 license