Course Information
Section 4: TR 9:55–11:10, Sci Cntr 240
Professor: Andrew Danner
Piazza: CS21 Q&A forum
Office: Sci 247
Office hours: You can stop by whenever my door is open, or email me for an appt.
Other Sections:
Zachary Palmer
(TR 8:30am–9:45am)
Rich Wicentowski (TR 9:55–11:10)
Jeff Knerr (MWF 11:30–12:20)
Introduction:
Welcome to CS21. This course will introduce fundamental ideas in computer
science while also teaching you how to write computer programs. We will
study algorithms for solving problems and implement solutions in the
Python programming language. Python is an
interpreted language that is known for its ease of use. We also introduce
object-oriented programming and data structures. A deeper coverage of these
topics will be presented in CS 35.
This course is appropriate for all students who want to learn how to write
computer programs and think like computer scientists. It is the usual first
course for computer science majors and minors. Students with advanced placement
credit or extensive programming experience should place out of this course and
instead begin with CS31 or CS35.
Textbook:
There is no required textbook for this course. There are, however,
required readings! See the
Schedule
for each week's reading assignment. We will primarily be using the online book
How to think like a computer scientist: Learning with Python by Elkner, Downey and Meyers.
Here are a few other useful online python resources:
Goals for the course:
By the end of the course, we expect that you will have developed the
following skills:
- Given a program, be able to simulate on paper how a computer would
execute the program, and show the results that would be produced.
- Given a problem, be able to design a clear, concise, and
correct pseudocode algorithm to solve it.
- Given a pseudocode algorithm,
be able to successfully implement it in Python.
- Be able to use top-down design to sub-divide a large problem into
reasonably-sized modular sub-problems.
- Given several algorithms for solving the same problem, be able
to analyze which algorithm would be more efficient in terms of running
time.
- Develop debugging and unit testing skills. Consistently use
these skills while implementing programs.
Schedule
This is a tentative schedule; it may change as we go.
WEEK |
DAY |
ANNOUNCEMENTS |
TOPIC & READING |
LABS |
1 | Sep 01 | | Introduction to Python and Unix - python and unix
- data types
- variables, assignment
- calling built-in functions
- print(), type(), int(), float(), str()
- user input: raw_input()
- for loops, sequences, range()
- writing and running a program
| In class Lab 0: unix, editing |
Sep 03 | |
2 | Sep 08 | | Writing simple programs - def main()
- more for loops
- accumulator pattern
- strings and lists: mutable vs immutable
- indexing, slicing, len()
- print(), print formatting
- from math import *
| In class Lab 1 |
Sep 10 | Drop/add ends (Sep 11) |
3 | Sep 15 | | Conditionals - boolean type
- comparison operators (<, >, ==, !=, etc)
- logical operators (and, or, not)
- mod operator
- if/elif/else
- nesting
- the "in" operator
- string comparisons
| In class Lab 2 |
Sep 17 | Quiz 1 |
4 | Sep 22 | | First functions, while loops - writing simple functions
- arguments, parameters
- while loops
- exceptions (try/except)
- random numbers
| In class Lab 3 |
Sep 24 | |
5 | Sep 29 | | Graphics, Using Objects - intro to objects
- intro to graphics
- RGB colors
- object.method()
- more practice with functions
- mouse and keyboard input
- animation
| In class Lab 4 |
Oct 01 | Quiz 2 |
6 | Oct 06 | | Fruitful Functions - more practice with functions
- incremental development
- boolean functions
- stack diagrams
- passing lists to functions
| In class Lab 5 |
Oct 08 | |
| Oct 13 | Fall Break |
Oct 15 |
7 | Oct 20 | | File IO, TDD - reading/writing files
- top-down design
- function stubs
- list-of-lists
- string and list methods
| In class Lab 6 |
Oct 22 | Quiz 3 |
8 | Oct 27 | | Searching - linear search
- analysis of algorithms
- binary search
| In class: Lab 7 |
Oct 29 | |
9 | Nov 03 | | Sorting - selection sort
- analysis of algorithms
- insertion and bubble sort
- idea of merge sort, recursion
| In class: Lab 8 |
Nov 05 | Quiz 4
CR/NC/W Deadline (Nov 06) |
10 | Nov 10 | | Recursion - recursive call
- base case
- leap of faith...
- graphics examples
- back to merge sort
| In class: Lab 9 |
Nov 12 | |
11 | Nov 17 | | Classes and Objects - creating our own objects
- instance variables
- self, __init__, __str__
- methods
- getters/setters
- class writer vs class user
- interface/information hiding
| In class: Lab 10 |
Nov 19 | Quiz 5 |
12 | Nov 24 | | More Classes | In class: MW Lab 11 |
Nov 26 | Thanksgiving |
13 | Dec 01 | | Linked Lists - python list vs linked list
- Node() class
- LinkedList() class
- linked list methods
- analysis of algorithms
| In class: Lab 12 |
Dec 03 | Quiz 6 |
14 | Dec 08 | | Wrap up
| |
Dec 11 | Final Exam 7pm-10pm Sci 101 |