Announcements
- Lab 12 is optional (but highly recommended!).
- Final Exam is Thur, May 12, 7-10pm in SciCen 101
Course Information
Section 2: MWF 10:30–11:20, Sci Cntr 256
Professor: Jeff Knerr
Office: Sci Cntr 238A (at back of 240 and 238)
Office hours: I will definitely try to be around on
Mondays from 2-4pm. You can also stop by whenever my door is open. I usually work from home on Thursdays.
Other Sections:
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:
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 hope 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 | Jan 18 | MLK Day...no classes
| 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()
- writing and running a program
for loops, sequences, range()
- Ch 1: The way of the program
- Ch 2: Variables, expressions and statements
- Ch 4, Sec 9: keyboard input
- Ch 4, Sec 10: type conversion
- Ch 2b: lists, looping,
range()
- unix summary
| In class: M W F
Lab 00: unix, editing |
Jan 20 | |
Jan 22 | |
2 | Jan 25 | | 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 *
- Ch 2: Variables, expressions and statements
- Ch 2b: lists, looping,
range()
- Ch 7: Strings (sections 1-4, 6, 13 only)
- Ch 9: Lists (sections 1-3, 5, 6, 8)
- vim summary
- vim tips and tricks!
| In class: M W F
Lab 01: first programs |
Jan 27 | |
Jan 29 | Drop/add ends |
3 | Feb 01 | | Conditionals
| In class: M W F
Lab 02: numbers and strings |
Feb 03 | Quiz 1 Topics |
Feb 05 | Quiz 1 |
4 | Feb 08 | | First functions, while loops
| In class: M W F
Lab 03: if/else |
Feb 10 | |
Feb 12 | |
5 | Feb 15 | | Graphics, Using Objects
| In class: M W F
Lab 04: while/functions |
Feb 17 | Quiz 2 Topics |
Feb 19 | Quiz 2 |
6 | Feb 22 | | Fruitful Functions
| In class: M W F
Lab 05: graphics |
Feb 24 | |
Feb 26 | |
7 | Feb 29 | | File IO, Top-Down Design
| In class: M W F
Lab 06: towers |
Mar 02 | Quiz 3 Topics |
Mar 04 | Quiz 3 |
| Mar 07 | Spring Break |
Mar 09 |
Mar 11 |
8 | Mar 14 | | More TDD
| In class: M W F
Lab 07: two-dice pig |
Mar 16 | |
Mar 18 | |
9 | Mar 21 | | Searching
| In class: M W F
Lab 07: two-dice pig |
Mar 23 | Quiz 4 Topics |
Mar 25 | CR/NC/W Deadline
Quiz 4 |
10 | Mar 28 | | Sorting
| In class: M W F
Lab 08: web queries |
Mar 30 | |
Apr 01 | |
11 | Apr 04 | | Recursion
| In class: M W F
Lab 09: contributions |
Apr 06 | Quiz 5 Topics |
Apr 08 | Quiz 5 |
12 | Apr 11 | | Classes and Objects
| In class: M W F
Lab 10: recursion |
Apr 13 | |
Apr 15 | |
13 | Apr 18 | | Classes and Objects
| In class: M W F
Lab 11: flappy bird |
Apr 20 | Quiz 6 Topics |
Apr 22 | Quiz 6 |
14 | Apr 25 | | Linked Lists
- python list vs linked list
Node() class
LinkedList() class
- linked list methods
- analysis of algorithms
- Ch 18: Linked Lists
| In class: M W F
Lab 12: linked lists |
Apr 27 | |
Apr 29 | Final Topics |
| May 12 | Final: 7-10pm Science Center 101 |