Matthew L. Wright
Assistant Professor, St. Olaf College

Principles of Computer Science

CS 121 ⋅ Spring 2016

Welcome to Principles of Computer Science! For course info and policies, please see the syllabus. For grades, log into Moodle. If you need help or have questions, please contact Prof. Wright; office hours are Mon. 1–2, Tues. 2–3, Wed. 9–10, Thurs. 9:30–10:30, Fri. 1–2 in RMS 409.

St. Olaf College offers Supplemental Instruction (SI) for CS 121. SI sessions occur Sundays 7–8pm, Tuesdays 8–9pm, and Thursdays 7–8pm in RNS 203.

Homework help is also available in RNS 203 at the following times: Tuesdays 9–10pm, Thursdays 8–9pm, and Sundays 8–9pm.

Below is a tentative outline of the course. Use the controls at right to make the page easier to view.

February 8–12 − hide
Monday
Feb. 8

Topics: problem-solving and algorithms, introduction to Python

Homework: due Wednesday, at the start of class

  1. Read General Introduction and Simple Python Data chapters, then submit a question about what you read.
  2. Use Idle (either on a Link computer or install it on your own machine) to type in and run these two Python programs. Take a screenshot of each program and its output, and submit them for HW1.
Wednesday
Feb. 10

Topics: simple Python programs, values and types, statements, operators, assignment

Homework: due Friday, at the start of class

  1. Read Debugging Interlude and Turtle Graphics chapters.
  2. Do Simple Python Data exercises 1, 2, 4, 5, 6, 10, and 12. Type your answers, save them as a PDF file, and submit your PDF file for HW2.
Friday
Feb. 12

Topics: Turtle graphics, methods, iteration

Quiz today on General Introduction and Simple Python Data chapters.

Homework: due Monday, at the start of class

  1. Write a program that draws a path consisting of 5 segments, each a different color.
  2. Do Turtle Graphics exercises 2, 4, 6, 10, and 12. Submit a PDF file containing solutions to these exercises, as well as your 5-segment program, for HW3.
  3. Read Python Modules chapter.
February 15–19 − hide
Monday
Feb. 15

Topics: modules in Python — math, random, etc.

Homework: due Wednesday, at the start of class

  1. Do Python Modules exercises 1, 2, and 3.
  2. Write a program that simulates ten rolls of a standard 6-sided die and computes the sum of the rolls. That is, your program should print ten random integers between 1 and 6, inclusive. Also print the sum of the ten integers.
  3. Submit a PDF file containing your solutions to the above problems for HW4.
  4. Read the Functions chapter.
Wednesday
Feb. 17

Topics: functions, arguments, variable scope, return values, accumulators

Homework: due Friday, at the start of class

  1. Do Functions exercises 1, 2, 7, 8, 9, and 10. For each exercise, paste your code and a screenshot of the output in a document, and submit your document for HW5.
  2. Read How the Internet Works chapters 1 and 2, and then submit at least one question about what you read.
Friday
Feb. 19
internet

Quiz today on Turtle Graphics, Python Modules, and Functions chapters.

Topics: Internet concepts and network architecture

Homework:

  1. Make sure you know the answers to the quiz questions at the end of chapters 1 and 2 in How the Internet Works. You can take these quizzes online.
  2. Read the Selection chapter of the Python text, and then submit a question about what you read.
February 22–26 − hide
Monday
Feb. 22

Topics: Boolean values, logical operators, and conditional statements

Homework: due Wednesday, at the start of class

  1. Re-read the Selection chapter of the Python text.
  2. Do Selection exercises 1, 2, 7, 8, 10, and 12. For each exercise, paste your code and a screenshot of the output in a document, and submit your document for HW6 (preferably as a PDF file).
Wednesday
Feb. 24

Topics: advanced conditional statements

Homework: due Friday, at the start of class

  1. Finish your solutions to the three problems distributed in class. You will need the is_vowel function. For each solution, paste your code and a screenshot of your program's output in a document. Upload your document (preferably in PDF format) to Moodle as HW7.
  2. Read How the Internet Works chapter 3, on the Link Layer, and then submit at least one question about what you read.
Friday
Feb. 26
internet

Quiz today on chapters 1 and 2 of How the Internet Works and the Selection chapter of the Python text.

Topics: link layer, introduction to while loops

Homework: But be sure to do the following, but nothing will be collected on Monday.

  1. Find the MAC address of your computer and/or phone.
  2. Read read the More About Iteration chapter, sections Iteration Revisited through Simple Tables. You may submit a question about what you read.
  3. Be sure you can do More about Iteration exercises 1 and 3.
February 29 – March 4 − hide
Monday
Feb. 29

Topics: iteration — for and while loops

Homework: due Wednesday, at the start of class

  1. Do More about Iteration exercises 2, 4, 5, 6. For each exercise, paste your code and a screenshot of your program's output in a document. Upload your document (preferably in PDF format) to Moodle as HW8.
  2. Read the Image Processing section through the end of the More About Iteration chapter. Make sure you can do exercise 7, but you don't have to turn in anything for this exercise.
Wednesday
Mar. 2

Topics: iteration application: image processing

Homework: due Friday, at the start of class

  1. Do More about Iteration exercises 8, 10, 11, and 12. Turn in your solutions to exercises 8, 10, and 12 by uploading your three Python files (one for each exercise) to Moodle as HW9. Do not upload a PDF file for this homework! Your solutions will be graded by running each Python file, so you must turn in the Python files this time.
  2. Read How the Internet Works chapter 4, on the Internetworking Layer, and then submit at least one question about what you read.
Friday
Mar. 4
internet

Quiz today on chapter 3 of How the Internet Works and the More about Iteration chapter of the Python text.

Topics: internetworking layer and IP addresses

Homework:

  1. Finish the Internetwork (IP) Assignment worksheet. Hand it in at the beginning of class on Monday.
  2. Read the Strings chapter, sections Strings Revisited through The Accumulator Pattern with Strings. Then submit a question about what you read.
  3. Check your understanding by doing Strings Exercise #1 (not to be turned in).

Note: the SI session on Sunday, March 6 will be 1–2pm in RNS 160D.

March 7–11 − hide
Monday
Mar. 7

Topics: string operations and methods

Homework: due Wednesday, at the start of class

  1. Do Strings exercises 3, 4, 5, 6, 7, 8, and 9. Turn in your solutions to 4, 6, and 8 by uploading your Python files to Moodle as HW10.
  2. Read the Turtles and Strings and L-Systems section through the end of the Strings chapter. You may submit a question about what you read.
Wednesday
Mar. 9

Topics: turtles, strings, and L-systems

Homework: due Friday, at the start of class

  1. Finish your solutions to the strings exercises distributed in class. Upload a Python file containing your functions to Moodle as HW11.
  2. Do Strings exercises 13–17 to see some interesting drawings you can make with L-systems. (Not to turn in.)
  3. Read How the Internet Works chapter 5 (The Domain Name System) and chapter 6 (Transport Layer). Then submit a question about what you read.
Friday
Mar. 11
internet

Quiz today on chapter 4 of How the Internet Works and the Python Strings chapter.

Topics: domain names and the transport layer

Homework:

  1. Read the Debugging section (for now, ignore the parts about recursion).
  2. Read the Lists chapter through the Which is Better? section. Then submit a question about what you read.
March 14–18 − hide
Monday
Mar. 14

Topics: list operations and methods

Homework: due Wednesday, at the start of class

  1. Read the Functions that Produce Lists section through the end of the Lists chapter. You may submit a question about what you read.
  2. Do Lists exercises 2–12. Turn in your solutions to the even problems (2, 4, 6, 8, 10, and 12) by uploading your Python file(s) containing these solutions to Moodle for HW12.
Wednesday
Mar. 16

Topics: more about lists and tuples

Homework: Study for the exam. As you study, consider the following:

Friday
Mar. 18
exam

Midterm Exam:

  • The exam will cover material from the online Python text through the Lists chapter, as well as the first six chapters of How the Internet Works.
  • The exam will contain conceptual questions and questions that ask you to write a few lines of code, similar to the quizzes.
  • You will have 55 minutes for the exam.
  • This will be a paper exam. Computers, calculators, phones, reference materials, and other similar things are not allowed during the exam.

Homework: Read the Files chapter before class on March 30. You may submit a question about what you read.

March 21–25 − hide
Spring Break
no class
March 28 – April 1 − hide
Monday
Mar. 28
no class
Wednesday
Mar. 30

Topics: files — reading and writing
   File for in-class example: numbers.txt

Homework: due Friday, at the start of class

  1. Do these files exercises and submit your solutions for HW13.
  2. Read How the Internet Works chapter 7, Application Layer.
  3. Read Introduction to HTML.
  4. submit a question about one of the above readings.
Friday
Apr. 1
internet

Topics: application layer protocols and HTML

Homework: due Monday, at the start of class

  1. Do these two exercises and submit your files for HW14. (HTTP solution)
  2. Read the Python Dictionaries chapter, and submit a question about what you read.
April 4–8 − hide
Monday
Apr. 4

Note: Starting this week, SI sessions will meet in the classroom.

Topics: dictionaries and key-value pairs

Homework: due Wednesday, at the start of class

  1. Do these three Python exercises and submit your files for HW15.
  2. Read the Recursion chapter, and submit a question about what you read.
Wednesday
Apr. 6

Topics: recursion

Homework: due Friday, at the start of class

  1. Do these Python exercises and submit your files for HW16.
  2. Read How the Internet Works chapter 8, Secure Transport Layer. Then submit a question about what you read.
Friday
Apr. 8
internet

Quiz today on chapter 7 of How the Internet Works and the Python Files and Dictionaries chapters.

Topics: secure transport — basic encryption and digital signatures

Python programs: Caesar cipher and SHA-1

Homework: due Monday, at the start of class

  1. Do these Python exercises and submit your files for HW17.
  2. Re-read the Recursion chapter. It should make more sense now!
April 11–15 − hide
Monday
Apr. 11

Topics: more about recursion

Homework: due Wednesday, at the start of class

  1. Do these exercises submit your solutions to Moodle for HW18.
  2. Reading the Python Classes and Objects - the Basics chapter. Then submit a question about what you read.
Wednesday
Apr. 13

Topics: classes and objects

Homework: due Friday, at the start of class

  1. Do these exercises submit your solutions to Moodle for HW19.
  2. Watch this video about Diffie, Hellman, Merkle, and public-key cryptography.
  3. Watch this video about the Diffie-Hellman key exchange.
  4. Begin thinking about the final project. What problem would you like to solve? Who will you work with?
Friday
Apr. 15
internet

Quiz today on shared-secret cryptography, digital signatures, and the Python chapters Recursion and Classes and Objects - the Basics.

Topics: secure transport: public key encryption and certificate authorities

Homework: due Monday, at the start of class

  1. Do these exercises submit your solutions to Moodle for HW20.
  2. Read the Python Classes and Objects - Digging a Little Deeper chapter. You may submit a question about what you read.
April 18–22 − hide
Monday
Apr. 18

Topics: classes, objects, and methods

Homework: due Wednesday, at the start of class

  1. Do Classes and Objects - Digging a Little Deeper exercises #1–6, and submit your solutions to Moodle for HW21.
  2. Read sections 2.4.1 and 2.4.2 from this introduction to Python graphics. You may submit a question about what you read.
    To use the Python graphics module, you will need to download graphics.py. You might also refer to the official documentation.
Wednesday
Apr. 20

Topics: Python graphics

Homework: due Friday, at the start of class

  1. Do these Python graphics exercises and submit your solutions to Moodle for HW22.
  2. Read: Top 10 Internet Privacy Tips, Good Passwords, and Wi-Fi Security.
  3. Be thinking about the final project. What problem would you like to solve? Who will you work with?

Note: the SI session on Thursday, April 21 will be 3:30–4:30pm in the classroom.

Friday
Apr. 22
internet

Quiz today on Python classes and objects

Topics: more about security

Homework: due Monday, at the start of class

  1. Read about how you are tracked online, and then do an online privacy self-check.
  2. Do this Python graphics exercise and submit your solution for HW23.
  3. To be prepared for Monday's class, read Using Parallelism to Analyze Very Large Files: Google’s Map Reduce Paradigm. You may submit a question about what you read.

Note: the SI session on Sunday, April 24 will be 3:00–4:00pm in the classroom.

April 25–29 − hide
Monday
Apr. 25

Topics: parallel computing with WebMapReduce, animation

Homework: due Wednesday, at the start of class

  1. Read Section 2.4.8: Animation of the Python graphics tutorial. Here are the animation program files from the tutorial.
  2. Do the Nose in Face Exercise (section 2.4.8.1) and the Faces Exercise (section 2.4.8.1). Submit your solutions for HW24.
  3. Prepare your project proposal. Each proposed group should bring to class on Wednesday a brief description of the proposed project and the names of the students in the group. (See also: Project Info)
Wednesday
Apr. 27

Topics: parallel computing with WebMapReduce; link to practice exercises

Homework: due Friday, at the start of class

  1. Read Using WebMapReduce and Counting Words with WebMapReduce.
  2. Think about the following WebMapReduce exercises: Poker Hands activities 1 and 2 (test data), and Car Information activities 1 and 2 (test data). These will be homework for next week.
  3. Read HTML Basics, HTML Elements, and HTML Attributes, HTML CSS, and CSS Syntax.
Friday
Apr. 29
internet

Quiz today on Python graphics and parallel computing with WebMapReduce

Topics: HTML and CSS

Homework:

  1. Do the following WebMapReduce exercises: Poker Hands activities 1 and 2 (test data), and Car Information activities 1 and 2 (test data). Submit your mapper and reducer functions for each activity for HW25 (due Monday, at the start of class).
  2. Begin the HTML and CSS assignment (due Wednesday, at the start of class).
  3. Begin planning the code that you will write for your project.

Note: the SI session on Sunday, May 1 will be 4:00–5:00pm in the classroom.

May 2–6 − hide
Monday
May. 2

Topics: creating web pages with Python;
   demonstration: helloWorldHTML.py; solution to in-class colors problem

Homework:

  1. Do the HTML and CSS assignment (due Wednesday, at the start of class).
  2. The Python and HTML assignment will be due Friday.
  3. Continue planning the code you will write for your project.

Note: the SI session on Tuesday, May 3 will be 3:00–4:00pm in the classroom.

Wednesday
May. 4

Topics: work on projects

Homework:

  1. Do the Python and HTML assignment (due Friday, at the start of class).
  2. Prepare your project design update due. Each group must bring to class Friday a brief update on the design of the project. This update should indicate what Python classes you will create for your project, and which Python modules you will employ.

Note: the SI session on Thursday, May 5 will be 3:30–4:30pm in the classroom.

Friday
May. 6

Note: class starts at 11:00 due to the Honors Day convocation.

Topics: work on projects

Homework: Work on your project.

May 9–13 − hide
Monday
May. 9

Topics: work on projects

Homework: Project status update due Wednesday in class. This update should indicate what has been accomplished so far, and what remains to be done.

Wednesday
May. 11

Topics: work on projects

Homework:

  1. Work on your project.
  2. If you are working by yourself, be prepared to give a brief presentation (3 to 5 minutes) of your project in class on Friday.
Friday
May. 13

Topics: presentations of individual projects

Homework:

  1. Finish your project!
  2. If you are working in a group, be prepared to give a brief presentation (3 to 5 minutes) of your project in class on Monday.
May 16–20 − hide
Monday
May. 16

Topics: presentations of group projects

Project code and user manual due:

Thursday
May. 19
exam
Final Exam, 9:00 – 11:00am
  • The exam will cover the material that we have studied in the online Python text as well as How the Internet Works and related topics.
  • Here is a list of topics that you should study.
  • The exam will contain a mix of conceptual questions and questions that ask you to write code.
  • You will have two hours for the exam.
  • This will be a paper exam. Computers, calculators, phones, reference materials, and other similar things are not allowed during the exam.
  • Lastly, make sure you are familiar with the St. Olaf final exam policies.