help     contact instructor

CSCI 261C/E: Programming Concepts

Fall/Winter 2011

Lecture Notes & Examples

Dec 7: Lecture 29: Semester Review

What have we learned this semester?

Homework: Prepare for the final exam and complete the final project.

Dec 5: Lecture 28: Pointers

slides

What is a pointer?

How do you interpret hexadecimal numbers?

What do the & and * operators mean?

What do the & and * do?

Homework: Read and execute the pointers sample code, continue the final project.

Dec 2: Lab: Final Project Help

no slides

Homework: Continue the final project.

Nov 30: Lecture 27: Event Handling, Memory, Stack, Stack Frames, Heap

slides

What are "events" and "interrupts?"

What are "event handlers?"

How do you capture mouse and keyboard events with OpenFrameworks?

How do you add new files to a Visual Studio project?

What is the stack?

What happens to the stack when a function is called?

What is a stack frame?

What is the heap?

Homework: Choose your final project partner and email your instructor.

Nov 28: Lecture 26: Exam Review, Final Project Discussion

no slides

Homework: Choose your final project partner and email your instructor.

Nov 18: Lab 12, Random Walk, General Review & Help

no slides

Homework: No new homework.

Nov 16: Lecture 24, Callers and Callees, Method Chaining, Helper Methods

slides

What is a "callee" or "calling object?"

What is method chaining? How do you use it?

What is a "helper method" or "helper function?" What are they for? Why do they tend to be private?

What is Brownian Motion aka Random ("Drunkard's") Walk?

Homework: Complete assignment 30_randomWalk.

Nov 14: Lecture 23, Pass-by-Reference, Objects & Memory

slides

How might you model a Troll battle?

What does it mean to "pass by value?"

How are arrays passed to functions?

What is pass-by-reference?

How do you pass objects to functions by reference?

How can you use external files to contain your function definitions?

Homework: Complete assignment 29_trollBattle.

Nov 11: Lab 11, Moving Squares

no slides

Homework: Complete assignment 28_movingSquares.

Nov 9: Lecture 22, Classes II

slides

How do you declare private data members and functions?

What are accessor methods?

What is the common pattern/convention to follow when implementing accessors?

How do you declare class constants?

Homework: Complete assignment 27_betterBox.

Nov 7: Lecture 21, Intro to Classes

slides

What is a class?

How can we use "classes" to define new "things" to the machine?

How do you define a class?

What are member variables? How do you create and define member variables?

What is a constructor?

How do you define and implement a constructor?

Homework: Complete assignment 26_boxTest.

Oct 31: Lecture 19, Objects, string Objects

slides

What is an object?

What do we mean when we say "an object encapsulates properties and behavior?"

Who "invented" the first object-oriented program?

How do you "talk to" or "send messages" to objects?

What are some common contexts for the "dot operator?"

Homework: Complete assignment 23_stringTest.

Oct 28: Lab 9, Letter Frequency

no slides

Homework: Complete assignment 22_letterFrequencyConsole.

Oct 26: Lecture 18, Multi-Dimensional Arrays

slides

What are multi-dimensional arrays?

How do you declare and use two-dimensional arrays?

What are some helpful visual metaphors when thinking about 2D arrays?

What are some common patterns and use cases for 2D arrays?

Homework: Complete assignment 21_dataMatrix.

Oct 24: Lecture 17, Memory, Variables, Arrays, Searching & Sorting

slides

How are variables stored in memory?

How are arrays stored in memory?

What are some benefits and drawbacks to arrays?

What do we mean when we say arrays provide access in "constant time?"

What is so special about searching and sorting?

Homework: Complete assignment 20_colorSquares.

Oct 20: Lab 8, Meet Array

no slides

How do you use arrays in C++?

Why are for loops a natural complement to arrays?

Homework: Finish reading Etter 6.1.

Oct 20: Lecture 16, Exam Recap and Introduction to Arrays

slides

Exam recap.

What is a data structure?

What is an array?

How do you use arrays in C++?

Why are for loops a natural complement to arrays?

Homework: Read Etter 6.1 and complete 19_meetArray.

Oct 13: Midterm Exam

Oct 12: Lecture 15, Review

no slides

How do we ace the midterm exam?

Study for exam I.

Oct 10: Lecture 14, Basic Algorithm Analysis & In-Class Worksheet

no slides

What are some factors that determine an algorithm's "quality?"

What do we mean by "computational complexity?"

What is "Big O" notation?

Study for exam I.

Oct 7: Lab 7, General Help & Review

no slides

No new homework!

Oct 5: Lecture 13, Functions and Scope, Recursion

no slides

How are local variables in one scope separate from variables in other function scopes?

What is recursion?

Homework: Complete assignment 18_factorial.

Oct 3: Lecture 12, Function Emphasis, Scope

slides

Functions review (parameters v arguments)

What is scope? How does it work?

Homework: Complete assignment 17_robotArmy and read Etter page 204.

Sep 30: Lab 6, Dating Diary

no slides.

How can you create reusable functions that encapsulate common tasks?

Homework: Complete assignment 16_datingDiary.

Sep 28: Lecture 11, Function Parameters, Arguments and Scope

slides

How do you declare a function prototype above main and definition below?

What is the difference between parameters and arguments?

What does it mean to "pass by value?"

What is scope? How does it work?

Homework: Complete assignment 15_robot and review Etter 5.1, 5.2 and 5.3 to page 198.

Sep 26: Lecture 10, Intro to Functions

slides

What is a function, in general?

What is a function in C++?

What are the parts of a function?

What is a user-defined function? What is a library function?

What is a formal parameter? What is an argument?

How do you declare, implement and use a function in your program?

Homework: Read Etter 5.1, 5.2 and 5.3 to page 198. Complete assignment 14_volumeFunction.

Sep 23: Lab 5, simpleStats

no slides.

What unwanted behavior happens when you try to open both an ifstream and an ofstream on a file simultaneously?

How can you capture more than one piece of input from an input stream?

Homework: Complete assignment 13_simpleStats.

Sep 21: Lecture 9, File I/O in Detail

slides

What is the general boilerplate code for basic file I/O?

How can you tell your program to create a file?

How do datatypes affect the behavior of reading input streams?

Homework: Read Etter pages 144 - 145, 4.5 and complete assignment 12_shiftCipher.

Sep 19: Lecture 8, File I/O Basics

slides

How do you tell your program to open and close a file?

How can you get your program to work with the contents of a file?

Which C++ library do you need to work with filestreams?

Homework: Read Etter 4.2 and complete assignment 11_dataAverage.

Sep 16: Lab 4, Number Guessing Championship

Homework: Complete assignment numberGuessing and read Etter 3.5.

Sep 14: Lecture 7, Flow Control (for loops) and Intro to Pseudo-Randomness

slides

How do you use a for loop?

How can you escape from a loop?

What are some common for loop patterns?

In general, when should you use a while loop rather than a for loop?

How might you convert a while loop to a for loop, and why would you do this?

How do you use rand() to generate a pseudo-random number?

What do we mean by pseudo-random?

Homework: Complete assignment 09_bottles.

Sep 12: Lecture 6, Flow Control (while loops)

slides

How do you use a while loop?

What is an infinite loop?

In general, when should you use a while loop rather than a for loop?

What is the difference between while and do while?

What do break and continue do?

What are some common loop patterns?

Homework: Read Etter 3.4. Complete assignment 08_bottles.

Sep 9: Lab 3, Rock Paper Scissors: Fight! (if, else if, else)

no slides

How might you use selection statements and your knowledge of character codes to create a simple game?

Homework: Complete 07_rockPaperScissors.

Sep 7: Lecture 5, Selection Statements (if, else if, else)

slides

How can you teach a computer to make decisions?

What are "selection statements"?

How do you use an if statement?

How are ints and bools related?

How do cin and cout treat bool values?

What are ASCII numeric codes for characters?

Homework: Reading chapter 3.3 and complete 05_asciiExploration.

Sep 5: Lecture 4, Boolean Logic

slides

How can I use screen specs, flowcharts, and pseudocode to guide my construction of a program?

What do the weird flowchart symbols mean?

Who was George Boole?

What is Boolean logic?

What are the Boolean operators and how do they work?

How do you declare boolean expressions?

Remember: expressions get evaluated and yield a value

Homework: Reading chapter 3.1 & 3.2 and complete 05_booleanExpressions.

Sep 2: Lab 2, Linear Interpolation

no slides

What is linear interpolation, how is it useful in an engineering context?

How do you implement a linear interpolation expression in C++?

Homework: Finish reading chapter 2 and complete 04_linearInterpolation.

Aug 31: Lecture 3, C++ Variables, Datatypes, Operators & Expressions

slides

Who is Alan Turing? What is a "Universal Machine?"

How do you declare variables?

What are some rules (both style and syntax) about variable names?

What are the primitive datatypes?

What do we mean, in general, when we talk about "classes" of things?

What does the % operator mean?

Why is C++ called C++ and how does the increment operator work?

Homework: Continue reading chapter 2 and complete 03_aircraft.

Aug 29: Lecture 2, C++ Fundamentals

slides

What happens when you "compile and run" a program?

What are object files?

What is the general structure of a C++ program?

How do you describe facts about the world that do change to the machine?

What do cout and cin do?

Homework: Begin reading chapter 2 and complete 02_sphereVolume.

Aug 26: Lab 1, Hellooooo World!

slides

Review: how do you describe facts about the world, that don't change, to the machine?

What does const indicate?

How should you set up your development environment?

How do you compile and run a program in Visual Studio?

Homework: Continue reading chapter 1 (skip 1.4) and complete 01_helloWorld.

Aug 24: Lecture 1, Introduction

slides

Introductions

What's a modern computer system? What is hardware? Software?

What do we mean by abstraction?

What is a computer program?

Who is Ada Lovelace?

Why are computer languages so weird?

Why program?

Administrivia.

Homework: Read chapter 1 (skip 1.4). Enroll in blackboard course. Enroll in Piazza. Read and understand the syllabus.





























































more fun stuff

Programming as a Passion

Highly recommended viewing (not just about Archaeopteryx).

How to Be a Programmer

If Giles postmodern programmer-bum story is too much for you, here's a more pragmatic essay.


Social Network or Systemic Isolation?

Justin Hall's breakdown video.


Relics from _why

Nobody Knows Shoes

Whys Poignant Guide to Ruby


Programming as Performance Art

A description of Live Coding at Shunt Lounge 1 Oct 2009


Syntax Poem

< > ! * ' ' #
^ " ` $ $ -
! * = @ $ _
% * < > ~ # 4
& [ ] . . /
| { , , SYSTEM HALTED

Waka waka bang splat tick tick hash,
Caret quote back-tick dollar dollar dash,
Bang splat equal at dollar under-score,
Percent splat waka waka tilde number four,
Ampersand bracket bracket dot dot slash,
Pipe curly-brace, comma comma CRASH.

Fred Bremmer and Steve Kroese, 1990 Infocus

Cool Graphics Programming?

.