CSC 161 Grinnell College Spring, 2012 Imperative Problem Solving and Data Structures

# Semester Outline for CSC 161

Module Dates Overall Purpose Summary and Main Topics Examples Lab Exercises Project Theme
0 (module details) Monday, January 23 — Friday, February 3 Introduction: Play a song
This module helps CSC161 students to gain familiarity with foundational concepts of C programming, the Scribbler robot, and the Linux terminal.
Basics of Linux and C
• basic Linux
• introduction to using the terminal
• elements of a C program, including variables and primitive types
• basic Scribbler actions (beeping)
• Pirates of the Caribbean
• Spirit Song
• Linux commands
• Elements of a C Program
• Using the Scribbler 2: connect, disconnect, sound
Program a song
1 (module details) Wednesday, February 1 — Monday, February 13 Motion (+song, motion)
This module introduces and explores the possibilities that are offered by loops and conditionals. These capabilities are applied to controlling a robot that creates sounds and moves simultaneously.
Control structures
• conditional statements
• loops (e.g. initialization, iteration, condition testing, loop body, for, while)
• Scribbler motion
• Dance
• Ice cream truck
• Types and variables (with casting)
• Conditionals, Scribbler motion
• Loops
• Loops and Scribbler 2 motion
Make the robot dance and sing

(details)
Tuesday, February 14 — Friday, February 17 Data representation Representation of numbers
• non-negative binary integers
• sign-magnitude, ones- and twos- complement notation
• floating point representations
• integer representation
• floating-point representation
2 (module details) Monday, February 20 — Friday, March 2 Motion and sensors
This module expands the CSC161 students' working knowledge of C language, improves problem solving and creativity, and creates an introduction to more complex programming.
functions and arrays
• one-dimensional arrays,
• writing functions,
• testing programs and functions,
• Scribbler 2 motion and sensors
• Avoid object
• Move until a wall and turn right
• Braitenberg machine: Alive
• 1-dimensional arrays
• testing:
• functions and parameters
• values, addresses, and the & operator (2 labs)
Wednesday, February 29 Hour Test 1
3 (module details) Monday, March 5 — Tuesday, March 13 Deepen understanding of imperative problem solving and C
The purpose of this module is to deepen understanding of the C language and smoothly integrate previous experience in the course into the larger framework of programming in C.
Arrays
• characters
• strings
• input/output
• forthcoming
• characters and strings
• Input/output
Robot follows typed commands
4 (module details) Wednesday, March 14 — Friday, April 6 Image Processing
The purpose of this module is to introduce the customizable nature of self-written programs by using structs and 2-dimensional arrays.
Structured data
• structs
• 2-dimensional arrays
• change pixel (shell, full program)
• transform pictures
• transform a pixel
• transform pixels in a picture
• sort pixels in a picture
Transform a Picture
5 (module details) Monday, April 9 — Wednesday, April 18 Music Composition
This module introduces dynamic data structures (with pointers and linked lists) as a means to store lines of music that evolve through the composition process.
Dynamic data storage
• pointers
• program management (separate header, implementation, application files)
• insert theme into canon/fugue
• pointers: create/return array, populate with sensor data
Music composition --- insertion of series of notes periodically into song tune
6 (module details) Friday, April 20 — Monday, April 30 Storage/retrieval Patterns
This module increases familiarity with programming in C, integrates the Scribbler 2's sensors into the curriculum, and continues to practice previously-introduced concepts
The purpose of this module is to clarify previously introduced concepts, such as
• more pointers and linked lists
• queues
• stacks
• Bash scripts
• Transform image in various ways
• stacks
• queues
• Bash scripts (for testing)
Do something interesting with pictures or travel in a maze
Friday, April 13 Hour Test 2
7 (module details) Tuesday, May 1 — Friday, May 11 Integrated Robotics
This module integrates and reviews material that has been presented through the semester, with a particular emphasis on C programming concepts and full usage of the Scribbler robot.