Announcements
- Final Exam: Saturday May 6, 7-10pm, Sci Cntr 101
- Final Exam Study Guide
- Final Exam Review Sessions:
You are welcome to attend any session and attend as many as you wish.
- Wednesday, May 3: 1-2:30, 181 Sci Center
- Thursday, May 4: 2:30-4, 183 Sci Center
- Friday, May 5: 1-2:30, 181 Sci Center
- Tia's Office Hours Week of May 1:
- Thursday, May 4: 10-11
- Friday, May 5: 10-11
- and by appointment
- Lab 12, is an optional lab assignment. It involves implementing the Python list
interface using a linked list class with method functions that match the
Python list interface. We will not collect nor will we grade this assignment. However, trying out at least some of it will be good practice for the final exam.
Class Information
Section 3: TR: 11:20–12:35, Sci Cntr 256
Professor: Tia Newhall
Office: Science Center 249
Office hours: Most Wednesdays 11-12, Fridays 10-11, and by appointment
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:
We will primarily be using the online book
How to think like a computer scientist: Learning with Python by Elkner, Downey and Meyers.
See the
Schedule for each week's reading assignment.
Here are a few other useful online resources (see Useful Links below for more):
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 17 | | 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()
| In class: week 1
Lab 0: unix, editing |
Jan 19 | |
2 | Jan 24 | | 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)
| In class: week 2
Lab 1: first programs |
Jan 26 | Drop/add ends (Jan 30) |
3 | Jan 31 | Q1 Study Guide | Conditionals
| In class: week 3
Lab 2: numbers and strings |
Feb 02 | Quiz 1
Quiz 1 |
4 | Feb 07 | | First functions, while loops
| In class: week 4
Lab 3: if/else |
Feb 09 | |
5 | Feb 14 | Q2 Study Guide (we have not yet talked about using the in operator with strings or lists (like: "LOVE" in S), so it will not be included on our section's quiz 2.) | Graphics, Using Objects
| In class: week 5
Lab 4: while loops/functions |
Feb 16 | Quiz 2 |
6 | Feb 21 | | Fruitful Functions
| In class: week 6
Lab 5: graphics/functions |
Feb 23 | |
7 | Feb 28 | Q3 Study Guide (we have not yet talked about using the in operator with strings or lists (like: "LOVE" in S), so it will not be included on our section's quiz 3.) | File IO, Top-Down Design
| In class: week 7
Lab 6: graphics/functions |
Mar 02 | |
| Mar 07 | Spring Break |
Mar 09 |
8 | Mar 14 | | More TDD
| In class: week 8
Lab 7: Part 1: top down design |
Mar 16 | |
9 | Mar 21 | Q4 Study Guide | Searching
| In class: week 9
Lab 7: Part 2: complete program |
Mar 23 | Quiz 4
CR/NC/W Deadline (Mar 24) |
10 | Mar 28 | | Sorting
| In class: week 10
Lab 8: climate data |
Mar 30 | |
11 | Apr 04 | Q5 Study Guide | Recursion
| In class: week 11
Lab 9: sorting |
Apr 06 | Quiz 5 |
12 | Apr 11 | | Classes and Objects
| In class: week 12
Lab 10: recursion |
Apr 13 | |
13 | Apr 18 | Q6 Study Guide | Classes and Objects
- more examples
- introduction to linked lists
| In class: week 13
Lab 11: classes |
Apr 20 | |
14 | Apr 25 | Quiz 6 | Linked Lists
- python list vs linked list
Node() class
LinkedList() class
- linked list methods
- analysis of algorithms
- Ch 18: Linked Lists
| In class: week 14 (same as week 13)
Lab 12: linked lists |
Apr 27 | Final Exam Study Guide |
| May 06 | Final Exam (7-10pm) |