Final Project Due Dec 10

CSCI 261A: Programming Concepts

Fall/Winter 2009

Lecture Notes & Examples

Dec 9: Lecture 26, Exam Review

Cumulative review and exam prep.

Homework: Finish your final project!

Dec 7: Lecture 25, Special Topics, Review

What is a switch statement and how do you use one?

What is the difference between an interpreted and a compiled program?

Where should we go from here?

(final exam review pt. 1)

Homework: Finish your final project!

Dec 4: Lab 11, Final Project

Bring your final project code to lab!

Homework: Finish your final project!

Dec 1: Lecture 24, Pointers

no slides

What is NULL?

Why should you initialize pointers to NULL (or 0)?

What is meant by "dynamic memory allocation?"

How do you tell the computer to allocate memory for you? (new)

How do you tell the computer to release allocated memory? (destroy)

How can you allocate memory for an array of objects?

Homework: Read section 9.4 and complete assignment AllocatedTriangles.

Nov 30: Lecture 23, Pointers

examples

When you assign a value to a variable, where does it go?

What is a variable reference? (&)

What is a pointer? How do you declare one?

What does it mean to dereference a pointer? (*)

How does const (used in two ways) affect how you can manipulate pointers?

What do arrays have to do with pointers?

What is special about incrementing array pointers?

Homework: Read pages 397 - 408.

Nov 23: Lecture 22, Classes, Operator Overloading, Friend Functions

no slides

Classes and operator overloading review

Friend functions review

Friend functions and operator overloading review

Homework: No new homework; complete assignments TrianglePrep, TimeByInterface, SearchStratagems AND FINAL PROJECT DOC.

Nov 20: Lab 10, TrianglePrep, TimeByInterface

no slides

Homework: complete assignments TrianglePrep and TimeByInterface.

Nov 18: Lecture 21, Midterm Review, friend Functions

friend function example

(exam review)

What is a friend function and how do you use one?

Homework: complete assignment SearchStrategems (due Nov 24)

Nov 16: Lecture 20, Operator Overloading, SolidOperator

slides

What is operator overloading and why is it convenient?

How do you overload operators?

Homework: read 10.1 & 10.2, complete assignment SolidOperator

Nov 9: Lecture 19, Midterm Review

no slides

Homework: Prepare for midterm exam II.

Nov 6: Lab 9, WhirlyBirdSearch

no slides

Homework: complete assignment WhirlyBirdSearch

Nov 4: Lecture 18, Getters & Setters, RandomHikerSearch

no slides

What are getters and setters?

What canonical pattern do typical getters and setters follow?

Homework: Complete assignment RandomHikerSearch

Nov 2: Lecture 17, Classes and Objects

slides

code: solid-class.cpp, CubeClass.h, CubeClass.cpp

What is an object? How do we program with real-world objects?

What are some general properties of objects?

How do you use the dot operator?

What is a class? (How do you tell a computer what your real-world object is like?)

What do keywords private and public do?

How do I define a class? How do I implement member functions?

What is a constructor? How do I declare one? How do I use one?

Homework: Read 8.1, 8.2, 8.4, 8.7 and complete assignment SolidBeginningsClass

Oct 30: Lab 8, ThresholdDataFunction, OverloadedInputValidation

function overloading notes, threshold-data.cpp, input-validation.cpp

What is function overloading and how do you do it?

Homework: Choose your final project partner, complete assignments ThresholdDataFunction (our version) and OverloadedInputValidation (official version).

Oct 28: No Lecture

yay for you

Homework: Choose your final project partner.

Oct 26: Lecture 16, rand()omness, LostHiker

slides

What is special about computers and randomness?

What is a random seed value and why might you always need one?

How do you use rand() and srand() properly?

LostHiker algorithm review, implementation.

Homework: Read 5.5, review slides and complete assignment LostHiker.

Oct 23: Lab 7, LetterFrequencyByFunction, ShiftCipherByFunction

letter-frequency.cpp, shift-cipher.cpp

Oct 21: Lecture 15, More FUNctions

slides

How do you declare a function that doesn't return anything?

How do you declare a function that doesn't require any input?

How should you declare const parameters?

What are static const global variables and how do you declare them?

How are array arguments passed?

How do you declare a formal parameter that is an array? (1d, 2d)

What is the Bubble Sort algorithm?

Homework: Review slides and complete assignment BubbleSort.

Oct 16: Lab 6, QuadraticRoots, MaclaurinCosine

no slides

Oct 14: Lecture 14, Functions II, Exam Review

slides

Functions review

How do you use a header (.h) and implementation (.cpp) file to define your functions?

What is scope?

What is pass-by-value? What is pass-by-reference?

Homework: Read 5.2 - 5.3 and complete assignment ReferenceSolidMetrics

Oct 12: Lecture 13, 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?

What is a header file?

Homework: Read 5.2 - 5.3 and complete assignment SolidBeginningsFunction

Oct 5: Lecture 12, Review

no slides

How do I ace the midterm?

Homework: study for midterm exam 1.

Oct 2: Lab 5, strings, LetterFrequency, PowerPlantDailyAverage

slides

What is the difference between a class and an object?

How does a string object behave (what functions does a string object provide)?

Homework: read chapter 6.9 and complete assignments LetterFrequency and PowerPlantDailyAverage.

Sep 30: Lecture 11, Multi-dimensional Arrays

slides

Array review

What is a two-dimensional array?

What are some ways to envision the structure of a 2D array?

How do you access and assign values in a 2D array?

How do you typically loop over a 2D array?

Homework: read chapter 7.1 and complete assignment PowerPlantAverage.

Sep 28: Lecture 10, Arrays

no slides

What data structure can you use to hold multiple values of a particular type?

What is an array?

How do you declare and initialize an array?

How can you assign a value to one position in an array?

Why does array size matter?

How can you create a loop to access/manipulate all values in an array?

Homework: read chapter 6.1 and complete assignment ThresholdData.

Sep 25: Lab 5, SutureRejects, CodeAdvice

no slides

How can you get a whole line of text using getline()?

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 line of input from cin?

Homework: Complete assignments SutureRejects and CodeAdvice.

Sep 23: Lecture 9, File I/O in Detail, ShiftCipher

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: Complete assignment ShiftCipher.

Sep 21: Lecture 8, File I/O Basics, IntegerChars

no 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: Complete assignment IntegerChars.

Sep 18: Lab 4, LoopRunTimes, TimberRegrowthYears

Homework: Complete assignment LoopRunTimes and TimberRegrowthYears.

Sep 16: Lecture 7, Flow Control (while loops)

slides

How do you use a for loop?

How can you escape a loop?

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

slides

How do you use a while loop?

What is an infinite loop?

What is the difference between while and do while?

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

Homework: Read 3.4. Complete assignment FiveModSum.

Sep 11: Lab 3, if, else if, InputValidation, PaperScissorsRock

slides

How do you use an if statement? (review)

Homework: Complete assignments InputValidation and PaperScissorsRock.

Sep 9: Lecture 5, Flow Control

slides

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: Read 3.3 (skip 'conditional operator' and switch). Complete assignment AsciiExplorations.

Sep 7: Lecture 4, Boolean Expressions

slides

Who is George Boole?

What is pseudocode?

What do the weird flowchart symbols mean?

What is a boolean expression?

What are the boolean operators and how do they work?

Homework: Read 3.1, 3.2. Complete assignment BooleanExpressions.

Sep 4: Lab 2, Variable Types and Casting

slides

What do we mean by procedural?

What happens when you have operations with different variable types? (p50 - 51 "mixed operation")

What is casting? (p51)

Homework: Complete assignments TKtoTF and AminoAcidWeight.

Sep 2: Lecture 3, C++ Fundamentals Continued

slides

Comments, case sensitivity, variable names, types, variable declaration syntax, constants, operators, increment/decrement, cmath library, functions (in brief).

Simple text formatting with cout (see pages 58 - 62).

Homework: Finish reading chapter 2.1 - 2.4, 2.7. Complete assignment SectorArea.

Aug 31: Lecture 2, C++ Fundamentals

slides and supplement

Who is Alan Turing? What is a Universal Machine?

What are some "cool" things programs can do?

C++ program structure, preprocessing directives, main(), code blocks, variables, types, I/O, CIN, COUT.

Homework: Read chapter 2.1 - 2.4, 2.7. Complete assignment NewtonToPounds.

Aug 28: Lab 1, Setting up Dev-Cpp

slides

Who is Bjarne Stroustrup?

Set up your development environment

Compile and run a program

Understand what we just did

Homework: Finish chapter 1 (skip 1.4). Complete assignment SolidBeginnings.

Aug 26: 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. Read and understand the syllabus.

more fun stuff

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


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.